Exploring the big match
Now, it's time to continue working on the fifa_players
exploration. Your next task is to examine the characteristics of players belonging to different teams.
Particularly, you are interested in players from two big rival teams: Barcelona and Real Madrid.
You decide that .pivot_table()
is the best tool to get your results since it's an easy way to generate a report. Also, it allows you to define aggregation functions and work with multiple indices.
The fifa_players
dataset is available for you. _Make sure you explore it. Check which data it contains from the players playing for each team.
Cet exercice fait partie du cours
Reshaping Data with pandas
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Use pivot table to display mean age of players by club and nationality
mean_age_fifa = fifa_players.____(index=____,
columns=____,
values=____,
aggfunc=____)
# Print mean_age_fifa
print(mean_age_fifa)