User Tools

Site Tools


Multiple Aggregations

The aggregation functionality provided by the agg() function allows multiple statistics to be calculated per group in one calculation. The syntax is simple, and is similar to that of MongoDB’s aggregation framework.

# Define the aggregation procedure outside of the groupby operation
# In the dictionary you must put the actual name of the column of the df NOT the name of the function
aggregations = {
    'date': lambda x: max(x)


Group-by a reference (ie. day) and count the occurrencies. Store it into a dataframe.

aggregations.txt · Last modified: 2017/01/05 14:24 by vincenzo