0
0
Data Analysis Pythondata~30 mins

First data analysis walkthrough in Data Analysis Python - Mini Project: Build & Apply

Choose your learning style9 modes available
First data analysis walkthrough
📖 Scenario: You have a small store and you want to analyze your weekly sales data to understand how well your products are doing.
🎯 Goal: You will create a simple program to store sales data, set a sales target, find products that met or exceeded the target, and display those products.
📋 What You'll Learn
Create a dictionary with product names and their sales numbers
Create a variable for the sales target
Use a dictionary comprehension to find products with sales greater than or equal to the target
Print the resulting dictionary of products meeting the target
💡 Why This Matters
🌍 Real World
Small business owners often analyze sales data to understand which products are performing well and which need attention.
💼 Career
Data analysts use similar techniques to filter and analyze data sets to provide insights for business decisions.
Progress0 / 4 steps
1
Create the sales data dictionary
Create a dictionary called sales with these exact entries: 'Apples': 150, 'Bananas': 90, 'Cherries': 120, 'Dates': 60, 'Elderberries': 30.
Data Analysis Python
Need a hint?

Use curly braces {} to create a dictionary. Each entry has a product name as a string key and a sales number as an integer value.

2
Set the sales target
Create a variable called target and set it to the integer 100.
Data Analysis Python
Need a hint?

Just assign the number 100 to the variable target.

3
Find products meeting the sales target
Use a dictionary comprehension to create a new dictionary called top_sellers that contains only the products from sales with sales greater than or equal to target. Use product and amount as the loop variables.
Data Analysis Python
Need a hint?

Use the syntax {key: value for key, value in dict.items() if condition} to filter the dictionary.

4
Display the top sellers
Write a print statement to display the top_sellers dictionary.
Data Analysis Python
Need a hint?

Use print(top_sellers) to show the filtered dictionary.