1. Learn
  2. /
  3. Courses
  4. /
  5. Data Manipulation with pandas

Connected

Exercise

Multiple grouped summaries

Earlier in this chapter, you saw that the .agg() method is useful to compute multiple statistics on multiple variables. It also works with grouped data. You can use built-in functions like min, max, mean, and median.

sales is available and pandas is imported as pd.

Instructions

100 XP
  • Get the min, max, mean, and median of weekly_sales for each store type using .groupby() and .agg(). Store this as sales_stats.
  • Get the min, max, mean, and median of unemployment and fuel_price_usd_per_l for each store type. Store this as unemp_fuel_stats.