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.
Diese Übung ist Teil des Kurses
Reshaping Data with pandas
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# 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)