LoslegenKostenlos loslegen

Create lots of groups

You want to find the mean Age of adults when grouping by the following categories:

  • "Workclass" (which has 9 categories)
  • "Above/Below 50k" (which has 2 categories)
  • "Education" (which has 16 categories).

You have developed the following bit of code:

gb = adult.groupby(by=[ "Workclass",
                        "Above/Below 50k", 
                        "Education"])

How many groups are in the gb object and what is the maximum possible number of groups that could have been created? The dataset adult, and the gb object have been preloaded for you.

Diese Übung ist Teil des Kurses

Working with Categorical Data in Python

Kurs anzeigen

Interaktive Übung

In dieser interaktiven Übung kannst du die Theorie in die Praxis umsetzen.

Übung starten