0PricingLogin
Data Science Academy · Lesson

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

  1. Split-Apply-Combine Explained
  2. Multiple Aggregations With agg
  3. Group by Several Keys
  4. transform for Group-Wise Features
← Back to Data Science Academy