0
0
Data Analysis Pythondata~30 mins

Reproducible analysis patterns in Data Analysis Python - Mini Project: Build & Apply

Choose your learning style9 modes available
Reproducible Analysis Patterns
📖 Scenario: You are working as a data analyst for a small bakery. You want to analyze daily sales data in a way that you can easily repeat the analysis every day with new data. This means your steps should be clear and easy to follow again and again.
🎯 Goal: Build a simple, reproducible analysis pattern in Python that loads sales data, sets a sales threshold, filters the data for days with high sales, and prints the filtered results.
📋 What You'll Learn
Create a dictionary with daily sales data
Set a sales threshold variable
Filter the sales data using a dictionary comprehension
Print the filtered sales data
💡 Why This Matters
🌍 Real World
Businesses often need to analyze sales or other data repeatedly. Using clear steps and variables makes it easy to update and rerun the analysis with new data.
💼 Career
Data analysts and scientists use reproducible patterns to save time and avoid mistakes when working with data regularly.
Progress0 / 4 steps
1
DATA SETUP: Create the sales data dictionary
Create a dictionary called daily_sales with these exact entries: 'Monday': 150, 'Tuesday': 200, 'Wednesday': 50, 'Thursday': 300, 'Friday': 100.
Data Analysis Python
Hint

Use curly braces {} to create a dictionary. Separate each day and sales number with a colon, and separate pairs with commas.

2
CONFIGURATION: Set the sales threshold
Create a variable called sales_threshold and set it to 150.
Data Analysis Python
Hint

Just assign the number 150 to the variable sales_threshold.

3
CORE LOGIC: Filter days with sales above the threshold
Create a new dictionary called high_sales_days using a dictionary comprehension. Include only the days from daily_sales where the sales value is greater than sales_threshold.
Data Analysis Python
Hint

Use a dictionary comprehension with for day, sales in daily_sales.items() and an if condition to filter.

4
OUTPUT: Print the filtered high sales days
Write a print statement to display the high_sales_days dictionary.
Data Analysis Python
Hint

Use print(high_sales_days) to show the filtered dictionary.