0Pricing
Data Science Academy · Lesson

Sort by One or Many Columns

Ascending, descending, and ties.

Order Brings Insight

Raw rows arrive in no useful order. Sorting puts the most interesting records on top so patterns jump out at a glance. 🔎

sort_values Is Your Tool

In pandas you reorder rows with sort_values. You name the column to sort by, and pandas hands back a freshly ordered DataFrame.

df.sort_values("price")

All lessons in this course

  1. Sort by One or Many Columns
  2. Your First groupby Summary
  3. Line and Bar Charts in matplotlib
  4. Labels, Titles, and Legends
← Back to Data Science Academy