Here are 5 hands-on practice problems for your Python 8: Data Visualization lesson — focused on real-world retail and business analytics:
Problem 1: Inventory Bar Chart
You have the following product stock data:
products = ["Ring", "Necklace", "Bracelet", "Earring"]
stock = [12, 5, 8, 15]
Task:
- Create a vertical bar chart using matplotlib
- Add title: “Current Inventory”
- Label axes and add grid lines
Problem 2: Daily Sales Line Chart
You tracked sales over 7 days:
days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
sales = [3000, 4500, 4000, 4200, 5000, 7500, 6800]
Task:
- Plot a line graph of sales using matplotlib
- Add data points (marker=’o’)
- Highlight the day with the highest sale in the title
Problem 3: Employee Sales Bar Plot with seaborn
Create a pandas DataFrame with this data:
| Employee | Total_Sales |
|---|---|
| Prince | 15000 |
| Neha | 13000 |
| John | 18000 |
Task:
- Use seaborn to create a bar plot of Total_Sales by Employee
- Add appropriate labels and a title
Problem 4: Price vs Stock Scatter Plot
You have the following data:
| Product | Price | Stock |
|---|---|---|
| Ring | 2500 | 10 |
| Necklace | 1800 | 5 |
| Bracelet | 1200 | 8 |
| Earring | 900 | 12 |
Task:
- Create a scatter plot using seaborn
- X-axis = Price, Y-axis = Stock, color by product name
- Use size=100 and add a chart title
Problem 5: Create Your Own Dashboard (Bonus)
Task:
- Create 3 subplots (side by side or top-bottom) using matplotlib:
- Line plot of daily sales
- Bar chart of inventory
- Scatter plot of price vs stock
💡 Use plt.subplot(1, 3, i) or plt.subplots() to arrange them.
Would you like the solution code for each of these too? Or shall I convert these problems into a printable PDF practice sheet?


Leave a comment