Project A — The Canteen Data Mini-Study
Individual or pairs (second semester appropriate) · Data you generate.
The brief
The canteen committee wants to know how students actually use it, but has no data. You will simulate three weeks of canteen sales with a documented generator, then analyse your own data as if it were real — including all the honesty problems that creates.
Part 1 — The generator (program)
Write generate.py producing sales.csv with columns day, item, price, count:
- 15 weekdays (three weeks), 4 items with fixed prices you choose;
- each day's counts random within item-specific ranges (e.g. sandwich 20–60, soup 10–40 …), with one documented weekday effect of your choice (e.g. Fridays sell 30% fewer hot meals);
- a fixed random seed so your data is exactly reproducible;
- deliberate imperfections, each occurring at low, stated rates: occasional negative counts, one duplicated day per week, and rare off-menu items.
Part 2 — Clean and profile (program + report)
Write clean.py that reports (not silently fixes) every defect it finds: rows dropped, rows fixed, duplicates merged — each with a count and a rule. Produce a one-page profile: total sales, best day, best item, and the distribution of daily totals.
Part 3 — Answer three questions (report)
- Which item earns the most across the three weeks, and does the weekday effect survive the missing/duplicate handling?
- Is the "best day" stable if you re-run the generator with a different seed? (Run 5 seeds; report the spread.)
- What question about the canteen can this data not answer, and why?
Analysis section
- Efficiency: what grows with the number of rows; show the arithmetic.
- The named design decision the course did not make for you (e.g. your weekday-effect representation, your duplicate-merge rule).
- Limitations: what the simulation assumes that real canteens violate.
Data rules
- Everything is generated by you; the generator is part of the submission.
- Seed reproducibility is mandatory: graders re-run your generator.
- Every cleaning rule is stated in the report — silent deletion fails the integrity bar for this project.