Sorting by values
📖 Scenario: You work in a small bookstore. You have a list of books with their sales numbers. You want to find out which books sold the most and which sold the least.
🎯 Goal: You will create a pandas DataFrame with book sales data, then sort the books by their sales numbers to see the best and worst sellers.
📋 What You'll Learn
Create a pandas DataFrame with book titles and their sales numbers
Create a variable to decide sorting order
Sort the DataFrame by sales numbers using the sorting order variable
Print the sorted DataFrame
💡 Why This Matters
🌍 Real World
Sorting data by values is common in sales reports, rankings, and any list where order matters.
💼 Career
Data analysts and scientists often sort data to find top performers or trends quickly.
Progress0 / 4 steps