October 2019
Beginner to intermediate
674 pages
16h 43m
English
In all of the previous use cases, we used sum aggregation. We were directly able to use sum without going through the aggregate function of Python. The sum() function that we used is a Cython-optimized implementation. Some other Cython-optimized implementations are mean, std, and sem (standard error of the mean). To implement other functions or a combination of aggregations, the aggregate function comes in handy:
sales_data.groupby("Category").aggregate(np.sum)
The following will be the output:

All the rules discussed in the sections on handling multiple keys and indices are applicable ...
Read now
Unlock full access