This article is part of a series of practical guides for using the Python data processing library pandas. To see view all the available parts, click here.
Building on the basic aggregation guide, in this guide we will look at some more advanced ways we can aggregate data using pandas. We are going to cover three techniques:
- Aggregating using different methods at the same time, for example, summing one column and taking the average of another.
- Defining and using custom aggregation functions which we can use to calculate aggregates that are not available “out of the box”.
- The
transform
method which can be used to do some very useful things with aggregated values.