Пример #1
0
def as_dataframe(groups):
    group_dfs = []
    groups = GroupBy.get_data_groups(groups)
    for group_name in groups:
        group_df = pd.concat(groups[group_name])
        group_df['GROUP_NAME'] = group_name
        group_dfs.append(group_df)
    result = pd.concat(group_dfs)
    return result
Пример #2
0
 def join_as_dataframe(groups):
     group_dfs = []
     groups = GroupBy.get_data_groups(groups)
     for group_name in groups:
         group_names = group_name.split('-')
         group_df = pd.concat(groups[group_name])
         group_col_names = []
         for name in group_names:
             group_col_names.append('GROUP' +
                                    str(group_names.index(name)))
             group_df['GROUP' + str(group_names.index(name))] = name
         group_dfs.append(group_df)
     result = pd.concat(group_dfs, sort=False)
     result.set_index(group_col_names, inplace=True, append=True)
     return result
Пример #3
0
def as_dataframe(groups, group_types):
    groups = GroupBy.get_data_groups(groups)
    result = pd.DataFrame(groups)
    result = result.transpose()
    return result