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
- Sort by One or Many Columns
- Your First groupby Summary
- Line and Bar Charts in matplotlib
- Labels, Titles, and Legends