Mini Data Analysis Project
Put everything together — this is what analysts actually do
What This Lab Is
This is not a lab with exercises and fill-in-the-blanks. This is a real mini analysis project.
You will use everything you’ve learned: data structures, functions, pandas, and matplotlib. The scenario: you’re a data analyst at a retail company. Your manager wants answers to 5 business questions from this quarter’s sales data.
Your job: write the code, analyze the data, and present your findings. There is starter code below to help you get started. A full sample solution is available collapsed at the bottom — try it yourself first!
The Scenario
You are a data analyst at RetailCo. It’s the end of Q1 2024. Your manager has sent you this message:
“I need a quick Q1 data summary before the board meeting tomorrow. Can you pull together: total revenue and units, category breakdown, salesperson rankings, any weekly pattern, and a dashboard chart? Thanks.”
The dataset: 90 days of Q1 sales data with revenue, units, category, region, and salesperson columns. It’s already built into the starter code below.
Your Tasks
- Q1: What was our total revenue and total units sold in Q1? What was the average daily revenue?
- Q2: Which category generated the most revenue? Which had the highest average order value (revenue per unit)?
- Q3: Who was the top salesperson? Show complete rankings for all 5 reps with their total revenue.
- Q4: Is there a weekly pattern in revenue? Compare the average daily revenue on weekdays (Mon–Fri) vs. weekends (Sat–Sun).
- Q5: Create a visualization dashboard (2×2 subplots): daily revenue trend, revenue by category (bar), revenue by salesperson (bar), revenue by region (horizontal bar).
Your Analysis Editor
The starter code includes the dataset and section headers. Fill in each section to answer all 5 questions. Then hit Run to see your results and charts.
Sample Solution (try it yourself first!)
This is one complete working solution. Your approach may differ — that’s fine! There’s no single right answer.
You can copy this into the editor above and run it to see the full output and dashboard.
Capstone Complete — Labs Finished!
You’ve completed all 10 Python Practice Labs! You can now write Python functions, analyze data structures, build pandas pipelines, and create matplotlib visualizations — the core toolkit of a working data analyst.
Keep practicing. The best way to get better is to find real data you care about and start asking questions of it.
← Return to Python Practice Labs Home