code: def df_from_groups(groups, columns=None):
      
      if columns is None:
          columns = list(groups.get_group(groups.indices.keys()[0]).columns)
      df = pd.DataFrame()
      for col, group_label in product(columns, groups.indices.keys()):
          label = '{}_{}'.format(col, group_label)
          df[label] = pd.Series(groups.get_group(group_label)[col].values)
      return df
docs: Create DataFrame of GroupBy object with columns for each product(grouped_value, column_label)