0
0
Data Analysis Pythondata~30 mins

Why visualization communicates findings in Data Analysis Python - See It in Action

Choose your learning style9 modes available
Why visualization communicates findings
📖 Scenario: Imagine you work in a small bakery. You have sales data for different types of bread over a week. You want to understand which bread sells the most and share this with your team clearly.
🎯 Goal: You will create a simple data structure for sales, set a threshold to highlight popular breads, use a loop to filter those breads, and finally create a bar chart to show the sales visually. This will help you see and explain the best-selling breads easily.
📋 What You'll Learn
Create a dictionary with bread types and their sales numbers
Set a sales threshold to identify popular breads
Use a for loop to find breads with sales above the threshold
Create a bar chart to visualize the popular breads and their sales
💡 Why This Matters
🌍 Real World
Visualizing sales data helps bakery teams quickly understand which products are popular and make better decisions about baking and stocking.
💼 Career
Data visualization is a key skill for data analysts and scientists to communicate insights clearly to non-technical team members and stakeholders.
Progress0 / 4 steps
1
Create sales data dictionary
Create a dictionary called bread_sales with these exact entries: 'Sourdough': 120, 'Baguette': 80, 'Rye': 45, 'Whole Wheat': 150, 'Focaccia': 60.
Data Analysis Python
Hint

Use curly braces {} to create a dictionary. Each bread type is a key, and its sales number is the value.

2
Set sales threshold
Create a variable called sales_threshold and set it to 70. This will help us find breads that sold more than 70 units.
Data Analysis Python
Hint

Just create a variable and assign the number 70 to it.

3
Find popular breads
Create a new dictionary called popular_breads that contains only the breads from bread_sales with sales greater than sales_threshold. Use a for loop with variables bread and sales to iterate over bread_sales.items().
Data Analysis Python
Hint

Start with an empty dictionary. Use a for loop to check each bread's sales. Add breads with sales above the threshold to the new dictionary.

4
Visualize popular breads
Import matplotlib.pyplot as plt. Create a bar chart showing the sales of breads in popular_breads. Use plt.bar() with keys as labels and values as heights. Add plt.title() with text 'Popular Bread Sales'. Finally, use plt.show() to display the chart.
Data Analysis Python
Hint

Use plt.bar() with keys and values from popular_breads. Add a title and labels for clarity. Finally, call plt.show() to see the chart.