0PricingLogin
Data Science Academy · Lesson

Your First groupby Summary

Counting and averaging per category.

From Rows to Groups

Often you do not care about single rows, you care about totals per category. groupby bundles rows that share a value so you can summarize each bunch.

Pick the Grouping Key

You choose a column whose values define the groups. Group by region and every distinct region becomes its own bucket of rows.

df.groupby("region")

All lessons in this course

  1. Sort by One or Many Columns
  2. Your First groupby Summary
  3. Line and Bar Charts in matplotlib
  4. Labels, Titles, and Legends
← Back to Data Science Academy