Summarize Sales Data Using pivot_table()
📖 Scenario: You work in a small store that sells different products in various cities. You have sales data for a week and want to understand total sales by city and product.
🎯 Goal: Build a summary table using pandas pivot_table() to see total sales for each product in each city.
📋 What You'll Learn
Create a pandas DataFrame with sales data
Define a pivot table configuration variable
Use
pivot_table() to summarize total sales by city and productPrint the resulting pivot table
💡 Why This Matters
🌍 Real World
Stores and businesses often need to summarize sales data quickly to understand which products sell best in which locations.
💼 Career
Data analysts and business intelligence professionals use pivot tables to create clear summaries and reports from raw data.
Progress0 / 4 steps