LoslegenKostenlos loslegen

Offensive or defensive player?

You're not convinced with your previous exploration - you've discovered patterns in the attacking and overall scores in fifa_players. You would like to compare both scores, so you would like to see both in the same DataFrame.

To do this, you'll need a way to pivot more than one column. You remember you can achieve this goal in two different ways: you could pivot the DataFrame using the list with the two columns, or you could extend the .pivot() method to all the columns present in the dataset.

The fifa_players dataset is available for you. 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.

# Pivot fifa_players to get overall and attacking scores indexed by name and identified by movement
fifa_over_attack = fifa_players.____(____=____, 
                                     ____=____, 
                                     ____=[____, ____])

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