beta_aggregate_groupby

beta_aggregate_groupby(
    data,
    by_column,
    columns
)

Parameters

  • data (json or pandas.DataFrame)

    The data that is being aggregated.

  • by_column (str)

    The name of the column to be grouped by.

  • columns (list[ColumnConfig])

    Specify how the rest of columns should be aggregated. See ColumnConfig specs.

Return

Aggregated data returned in a DataFrame type

Examples

Group the data by the value of the "round" column and add up the value of the "amount" column in each group.

#mydata

index      timestamp                       amount     round
0        0  1624491090000                        5     2203
1        1  1624439813000   547.629899125388326601     2203
2        2  1624051798000    73.892474980964350941     2198
3        3  1623936195000     2.278677313065779378     2196
4        4  1624473692000   222.903518801217093934     2203
..     ...            ...                      ...      ...
131     47  1624409333000                      232     2202
132     48  1624296239000     6.611818776620084244     2201
133     49  1624271289000  2000.217857369121629214     2200
134     50  1624215406000                      120     2200
135     51  1624009640000   166.873390434037831172     2197

Last updated

Was this helpful?