LoslegenKostenlos loslegen

Only going up

After your last analysis, you are excited to keep working with the obesity dataset. You have added an extra column, the variation column, which indicates the range in which the percentage varies through regions in the same country. You are not sure if the mean is the best metric to summarize obesity levels.

So you decide to explore the median percentage and variation of obesity by year and biological sex. Also, you want to get the maximum percentage observed by country, year, and biological sex.

The DataFrame obesity is available in your session. Make sure to examine it in the console!

Diese Übung ist Teil des Kurses

Reshaping Data with pandas

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Stack obesity, get median of columns and unstack again
median_obesity = obesity.____().____(____).____()

# Print median_obesity
print(median_obesity)
Code bearbeiten und ausführen