Multiple Aggregations With agg
Different functions per column.
Why One Number Is Not Enough
A single mean hides a lot. With agg you can request several summaries at once and see the fuller picture.
Meet agg
The agg method takes a list of functions and runs every one of them on each group in a single pass.
df.groupby("city")["sales"].agg(["mean", "max"])All lessons in this course
- Split-Apply-Combine Explained
- Multiple Aggregations With agg
- Group by Several Keys
- transform for Group-Wise Features