Week 3 • Thursday

Block 27: GroupBy & Aggregations

Summarize data by category using groupby.

Concepts

Code Examples

See exercise below.

Exercise

Using the tips dataset (seaborn), compute average tip by day and by smoker status. Find the top 3 days by total bill amount.

Homework

Compare groupby().mean() with a manual loop approach — what are the advantages?