Aan de slagGa gratis aan de slag

The tallest and the heaviest

You will continue your exploration of characteristics of players in fifa_players belonging to two teams: FC Barcelona and Real Madrid. As your last task, you are interested in exploring the maximum height and weight separated by teams and nationality. You will also compare two years, 2000 and 2010.

You have two columns that you want to set as an index, so you will need to use pivot_table().

The fifa_players dataset is available for you. It contains data about the club, nationality, height, weight, and year of the players playing for each team.

Deze oefening maakt deel uit van de cursus

Reshaping Data with pandas

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Define a pivot table to get the characteristic by nationality and club
fifa_mean = fifa_players.pivot_table(____=[____, ____], 
                                     ____=____)

# Print fifa_mean
print(fifa_mean)
Code bewerken en uitvoeren