Exercise

Named aggregations

You've seen how .groupby() and .agg() can be combined to show summaries across categories. Sometimes, it's helpful to name new columns when aggregating so that it's clear in the code output what aggregations are being applied and where.

Your task is to create a DataFrame called continent_summary which shows a row for each continent. The DataFrame columns will contain the mean unemployment rate for each continent in 2021 as well as the standard deviation of the 2021 employment rate. And of course, you'll rename the columns so that their contents are clear!

The unemployment DataFrame is available, and pandas has been imported as pd.

Instructions

100 XP
  • Create a column called mean_rate_2021 which shows the mean 2021 unemployment rate for each continent.
  • Create a column called std_rate_2021 which shows the standard deviation of the 2021 unemployment rate for each continent.