Filter Sales Data Using pandas query()
📖 Scenario: You work in a store and have a table of sales data. You want to quickly find sales that meet certain conditions, like sales above a certain amount or sales from a specific product.
🎯 Goal: Build a small program that uses pandas query() to filter sales data based on a condition.
📋 What You'll Learn
Create a pandas DataFrame with sales data
Create a variable for the sales amount threshold
Use
query() to filter rows where sales are above the thresholdPrint the filtered DataFrame
💡 Why This Matters
🌍 Real World
Filtering data quickly helps businesses analyze sales trends and make decisions fast.
💼 Career
Data analysts and scientists often use pandas <code>query()</code> to filter large datasets efficiently.
Progress0 / 4 steps