Module 8: Complete Retail Analysis Capstone · Lecture 32 of 32
Finish the course by delivering a reproducible analysis package another person can review. The final artifact combines audited tables, explicit limitations, a concise memo, and a rebuild command rather than a collection of disconnected screenshots.
What you will learn
- Deliver a reviewed HTML report and supporting machine-readable artifacts.
- Demonstrate reproducibility and contractual correctness.
- Evaluate the project against an evidence-based rubric.
Understand the problem
Deliver the complete bundle
Run the pipeline from a clean environment, then run every lecture and the pytest suite. The final bundle contains audit.json, manifest.json, channel-kpis.csv, monthly-kpis.csv, region-kpis.csv, and analysis-report.html. The chart from Lecture 19 is an additional visual explanation. Keep source hashes and environment versions with the report so another learner can rebuild the same tables.
Write the decision memo
The memo should answer the bounded brief: describe the observed total and population, identify the largest recorded channel without causal language, disclose invalid records and anonymous identity, and propose the next evidence to collect. A reasonable next investigation is to obtain verified cost, exposure, and broader history data before judging profit, incremental acquisition return, or first-ever customer retention.
Review with a concrete rubric
Allocate 25 points to correct metric contracts and reconciled amounts, 20 to cleaning and evidence preservation, 20 to reproducible code and meaningful tests, 15 to interpretation and statistical limitations, 10 to readable charts and tables, and 10 to clear delivery and data minimization. A project that cannot rebuild or that makes an unsupported causal claim needs correction even if its visual presentation is polished.
Extend responsibly
For an original portfolio version, replace the fictional business question, add a genuinely new dataset with permission, and write new contracts and tests. Do not present this generated teaching dataset as client work. Continue into the site’s SQL, PostgreSQL, machine-learning, or data-engineering courses according to the next skill you need. Completing the material provides practice; it does not constitute accreditation or a guaranteed employment outcome.
Run the worked example
Download and extract the course kit linked below. Open a terminal in the extracted folder, complete the setup in Lecture 2, and run python run_course.py --lesson 32 --examples-only. Each script starts from the shared dataset; it does not depend on a notebook cell from another lecture. All retail records are fictional and amounts are integer paise unless a chart explicitly says INR.
from pathlib import Path
import numpy as np
import pandas as pd
from course_data import load_orders, load_raw, load_customers, clean_orders, ROOT, OUT
import json
from pipeline import run_pipeline
destination = OUT / 'final-report'
result = run_pipeline(ROOT / 'data' / 'orders_raw.csv', destination,
ROOT / 'data' / 'customers.csv')
report = destination / 'analysis-report.html'
manifest = json.loads((destination / 'manifest.json').read_text(encoding='utf-8'))
assert manifest['accepted_orders'] == 239
assert manifest['net_paise'] == 24112420
assert manifest['reporting_timezone'] == 'Asia/Kolkata'
assert 'Fictional' in report.read_text(encoding='utf-8')
assert 'causal' in report.read_text(encoding='utf-8')
print('Final report: outputs/final-report/analysis-report.html')
print('Rebuild: python pipeline.py --out outputs/final-report')
print('Verification: python run_course.py && python -m pytest -q')
Verified output
Final report: outputs/final-report/analysis-report.html
Rebuild: python pipeline.py --out outputs/final-report
Verification: python run_course.py && python -m pytest -q
Open the complete sample capstone report and compare its audit, tables, and memo with your own rebuilt version.
Walk through the result
The final checks read the delivered manifest rather than relying only on an in-memory variable. The report must identify the fictional source and its causal limitation. The rebuild command produces a fresh bundle from immutable inputs. A reader can inspect exact tables, the row audit, and input hashes alongside the memo. In a real deployment, use versioned output directories and a reviewed publication boundary after all checks succeed.
Common mistakes and diagnosis
Do not call a project complete because an HTML file opens. Verify its totals, links, units, labels, and limitations. Do not retain stale charts after changing the source. A passing test suite does not authorize publishing private source data. Do not replace a nuanced result with a sales headline promising profits or job placement. The deliverable should make uncertainty and scope easy to find.
Practice assignment
Perform an independent review using the 100-point rubric. Rebuild into a new folder, compare summary CSVs, and write three specific improvements. As an extension, add a new failure-path test and explain which conclusion it protects. Submit source, outputs, test results, and the five-sentence memo.
Worked solution and explanation
Add the following code below the worked example, or run the matching file in the solutions folder. Compare the result with the business definition before trusting a passing assertion.
review_dir = OUT / 'independent-review'
reviewed = run_pipeline(ROOT / 'data' / 'orders_raw.csv', review_dir, ROOT / 'data' / 'customers.csv')
for filename in ['channel-kpis.csv', 'monthly-kpis.csv', 'region-kpis.csv']:
assert (destination / filename).read_bytes() == (review_dir / filename).read_bytes()
assert reviewed['audit'] == result['audit']
print('Independent rebuild matched all three summary tables and the audit.')
Check your understanding
What evidence distinguishes a complete analytical project from a plausible notebook?
Answer guide
A clear decision brief, explicit grain and metric definitions, immutable inputs, an auditable cleaning policy, reconciled results, independently runnable code, meaningful failure-path tests, readable outputs, honest limitations, and a documented rebuild command. The reviewer should be able to reproduce and challenge the conclusion without relying on the original author's interactive session.
Reference and next step
Download the complete course kit: datasets, all examples, solutions, and capstone.
Return to the full Data Analysis with Python and pandas curriculum.
