Create DataFrame of GroupBy object with columns for each product(grouped_value, column_label)

def df_from_groups(groups, columns=None):
    """Create DataFrame of GroupBy object with columns for each product(grouped_value, column_label)"""
    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