Get startedGet started for free

DataFrame to CSV

You're almost there! To make things easier to read, you'll need to sort the data and export it to CSV so that your colleagues can read it.

pandas as pd has been imported for you.

This exercise is part of the course

Data Manipulation with pandas

View Course

Exercise instructions

  • Sort airline_totals by the values of bumps_per_10k from highest to lowest, storing as airline_totals_sorted.
  • Print your sorted DataFrame.
  • Save the sorted DataFrame as a CSV called "airline_totals_sorted.csv".

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create airline_totals_sorted
airline_totals_sorted = ____

# Print airline_totals_sorted
____

# Save as airline_totals_sorted.csv
____
Edit and Run Code