Pandas Aggregation and Grouping

Aggregation

Simple Aggregations

Pandas describe

Pandas Built-in Aggregations

Aggregation Description
count total number of items
first, last first and last item
mean, median mean and median
min, max minimum and maximum
std, var standard deviation and variance
mad mean absolute deviation
prod product of all items
sum sum of all items

Groupby

Basic groupby Example

Performing Multiple Aggregations

Filtering

Transformation

Applying Arbitrary Functions

Specifying the Split Key

Specifying the Split Key (Continued)