9.1. Exercises

Practice Sorting

Instructions:
Running a coding exercise for the first time, could take a bit of time for everything to load. Be patient, it could take a few minutes.

When you see ____ in a coding exercise, replace it with what you assume to be the correct code. Run it and see if you obtain the desired output. Submit your code to validate if you were correct.

Let’s sort our hockey dataframe.

Tasks:

  • Sort your hockey_players dataframe by Salary from most to least and name your new dataframe as rich_players.
  • Display it.
Hint 1
  • Are you sure you are using sort_values?
  • Are you using the argument ascending=False to order Salary in descending order?
Fully worked solution: