Aggregation-based features
📖 Scenario: You work in a small online store. You have a list of orders with customer names and order amounts. You want to learn how to create new features by grouping data and calculating summary numbers like total spending per customer.
🎯 Goal: Build a small program that groups orders by customer and calculates the total amount each customer spent.
📋 What You'll Learn
Create a list of orders with customer names and amounts
Create a variable to hold the minimum amount to consider
Use a dictionary comprehension to sum amounts per customer only if the total is above the minimum
Print the resulting dictionary of customers and their total spending
💡 Why This Matters
🌍 Real World
Stores and businesses often need to summarize customer purchases to understand buying habits and target marketing.
💼 Career
Data analysts and data scientists frequently create aggregation features to prepare data for machine learning or reporting.
Progress0 / 4 steps