0
0
Data Analysis Pythondata~30 mins

Descriptive statistics review in Data Analysis Python - Mini Project: Build & Apply

Choose your learning style9 modes available
Descriptive statistics review
📖 Scenario: You work as a data analyst for a small retail store. You have collected daily sales data for a week. Your manager wants you to summarize this data to understand the sales performance.
🎯 Goal: You will create a list of daily sales, set a threshold for high sales, filter the sales above this threshold, and then calculate basic descriptive statistics like mean and median for these high sales.
📋 What You'll Learn
Create a list called daily_sales with exact values for 7 days
Create a variable called high_sales_threshold with the value 200
Use a list comprehension to create a list called high_sales containing sales greater than high_sales_threshold
Calculate the mean and median of high_sales using the statistics module
Print the mean and median values exactly as shown
💡 Why This Matters
🌍 Real World
Retail stores and many businesses collect daily sales data. Summarizing this data helps managers understand performance and make decisions.
💼 Career
Data analysts often need to clean, filter, and summarize data using descriptive statistics to provide insights to stakeholders.
Progress0 / 4 steps
1
Create the daily sales data
Create a list called daily_sales with these exact values: [150, 220, 180, 300, 250, 90, 400]
Data Analysis Python
Hint

Use square brackets to create a list and separate the numbers with commas.

2
Set the high sales threshold
Create a variable called high_sales_threshold and set it to 200
Data Analysis Python
Hint

Just assign the number 200 to the variable high_sales_threshold.

3
Filter high sales using list comprehension
Use a list comprehension to create a list called high_sales that contains only the sales from daily_sales greater than high_sales_threshold
Data Analysis Python
Hint

Use the syntax: [item for item in list if condition].

4
Calculate and print mean and median of high sales
Import the statistics module. Calculate the mean and median of high_sales using statistics.mean() and statistics.median(). Then print the results exactly as: Mean: <mean_value> and Median: <median_value>
Data Analysis Python
Hint

Use import statistics at the top. Then use statistics.mean(high_sales) and statistics.median(high_sales). Use f-strings to print.