Stage 5 track
Track: Data Analytics
Capstone: Sales dashboard · Tools: NumPy, pandas, Matplotlib, Jupyter, SQL · Time: ~2 weeks (one step every 2–3 days, ~3 hours a day)
Who this track is for
You like working with numbers, spreadsheets and the "what does this data actually tell us" question more than building services. You were comfortable with lists, dicts and comprehensions in Part 4, and with SQL and sqlite3 in Part 12.
Job roles this maps to: Data Analyst, Business/Reporting Analyst, BI Developer, and a stepping stone toward Junior Data Scientist roles.
You already have, from earlier stages:
- Lists, dicts, comprehensions (Part 4)
- Reading/writing CSV and JSON files (Part 8)
- SQL basics —
SELECT,WHERE,GROUP BY,JOIN— andsqlite3(Part 12)
This track trades hand-written loops over lists for vectorized operations over whole columns of data at once, which is both faster and, once you're used to it, shorter to write and read.
What you'll learn, step by step
Step 1 — NumPy
Builds on: Part 4 (lists), Part 2 (numbers and operators).
- The
ndarray: a grid of numbers of one type, stored compactly. - Vectorized operations:
prices * 1.18multiplies every element at once, instead of aforloop. - Basic indexing, slicing and boolean masks (
prices[prices > 1000]) — a more powerful version of the list slicing from Part 4. - Simple statistics: mean, sum, min, max over an array.
Step 2 — pandas basics
Builds on: Step 1 (NumPy, which pandas is built on), Part 8 (CSV/JSON files).
Series(one labelled column) andDataFrame(a labelled table — think "a spreadsheet, as a Python object").- Reading data in:
read_csv,read_json— the same kinds of files you wrote and read by hand in Part 8, now loaded as a table in one call. - Selecting, filtering, sorting rows and columns.
- Handling missing data.
Step 3 — pandas + SQL together
Builds on: Part 12 (SQL, GROUP BY, JOIN, sqlite3).
groupbyin pandas does the same job as SQL'sGROUP BY— compare the two side by side using data you already know how to query from Part 12.- Joining/merging two DataFrames, the pandas equivalent of a SQL
JOIN. - Reading a SQL table straight into a DataFrame, and writing a DataFrame back into a SQLite database.
- Reshaping data: pivot tables — a "summary by category and month" table, the kind you'd build with
GROUP BYtwice in SQL.
Step 4 — Matplotlib
Builds on: Step 2–3 (DataFrames to plot).
- Line, bar and pie charts from a DataFrame or Series.
- Labelling axes, titles, legends — a chart with no label is not a finished chart.
- Saving a chart to a file instead of just showing it on screen.
Step 5 — Jupyter
Builds on: everything above.
- Notebooks mix code, output and explanatory text (Markdown) in one document — the natural format for an analysis you want someone else to follow, not just a result you want someone else to run.
- Structuring a notebook: one clear question or step per section, so a reader can follow your reasoning, not just your code.
- Exporting a notebook (e.g. to share results without requiring the reader to run Python).
Step 6 — Polish (optional buffer)
Finish the dashboard notebook, clean up the markdown narration, write the README.
Setup pointers (official docs only)
| Tool | Official docs |
|---|---|
| NumPy | https://numpy.org/ |
| pandas | https://pandas.pydata.org/ |
| Matplotlib | https://matplotlib.org/ |
| Jupyter | https://jupyter.org/ |
Install everything inside a virtual environment, as you learned in Part 7. SQL itself needs no install — you'll keep using the sqlite3 standard-library module from Part 12 as your data source.
Capstone brief: Sales dashboard
User stories
- As a shop owner, I want to see total sales by month, so I know if the business is growing.
- As a shop owner, I want to see my top-selling products, so I know what to restock.
- As a shop owner, I want to see sales by category or region, so I know where to focus.
- As a shop owner, I want one notebook I can open and re-run whenever I have new data, instead of redoing the analysis by hand.
- As a shop owner, I want the numbers backed by clear charts I can glance at, not just a wall of numbers.
Architecture sketch
raw sales data (CSV export, or rows in a SQLite table — your choice)
│
▼
┌───────────────────────────┐
│ load & clean │ pandas: read_csv / read_sql, fix types,
│ │ handle missing values, drop duplicates
└────────────┬──────────────┘
▼
┌───────────────────────────┐
│ transform & aggregate │ pandas groupby / pivot_table / merge:
│ │ "sales by month", "top 10 products", ...
└────────────┬──────────────┘
▼
┌───────────────────────────┐
│ visualize │ Matplotlib charts, one per business question
└────────────┬──────────────┘
▼
sales_dashboard.ipynb (Jupyter notebook: narration + code + charts)
Each step is its own notebook section: load, clean, one section per business question, charts, a short written conclusion at the end.
Milestones
- Data in — load your sales data (a CSV you create, or a SQLite table) into a DataFrame; print its shape and first few rows.
- Clean — fix column types (dates as dates, prices as numbers), handle any missing or duplicate rows, and say in markdown what you changed and why.
- Monthly trend — a table and a line chart of total sales per month.
- Top products — a table and a bar chart of the top 10 products by revenue.
- Breakdown — sales by category and/or region, using
groupbyor a pivot table, with a chart. - Narrate — add markdown cells explaining what each chart shows and one takeaway per section, so the notebook reads like a short report, not just code output.
Acceptance checklist
- The notebook runs top to bottom with no errors on a fresh restart (Jupyter's "Restart & Run All")
- At least three business questions are answered, each with a table or number and a labelled chart
- Every chart has a title, axis labels, and (if more than one series) a legend
- At least one aggregation is done with
groupbyor a pivot table, and you can explain it in SQL terms (whatGROUP BY/JOINit corresponds to) - Markdown cells explain each step — the notebook is readable without reading the code
- A short "Conclusion" section at the end states the 2–3 biggest takeaways in plain English
Stretch goals
- 🟡 Pull the raw data from a SQLite database with
pd.read_sqlinstead of a CSV. - 🟡 Add a year-over-year or month-over-month percentage change column.
- 🔴 Turn the notebook's charts into a small script that regenerates them automatically whenever new data arrives.
- 🔴 Export the final charts and summary table to a single PDF or HTML report.
How you'll know you're done
- Every item in the acceptance checklist above is ticked
- You can explain, out loud, why you used
groupby(or a pivot table) for each aggregation, and what SQL query does the same job - You can point to one chart and explain the business decision it supports
- The notebook is on GitHub with a README that states the business questions it answers and how to run it (what data file it expects, which command opens it)
- You can demo it live: open the notebook, run it top to bottom, and talk through the charts