Module 01 Activity
Scenario
You have been sent a CSV and asked for a monthly figure. Set the work up so the second month costs you nothing.
What you build
A project folder that a colleague can clone and run, producing a table and a chart with one command.
Steps
- Create the four folders and put the supplied CSV in the raw folder. Write down the rule that nothing you write ever lands there.
- Write a script that reads the file with a relative path only. Search your own script for your username and remove anything you find.
- Build the analysis one line at a time, printing the row count, the column count and the column names after each step.
- Add one arithmetic check at the point the numbers first mean something — a total, or a set of proportions that should sum to one.
- Save both the table and the chart from code into the outputs folder.
- Delete the outputs folder, re-run the script, and confirm both files come back.
Evidence to hand in
- The folder listing.
- The script, with only relative paths.
- The per-step shape output.
- The arithmetic check and what it returned.
- The two regenerated output files.
- A note of what the delete-and-rebuild test proved.
Review checklist
- No path in the script contains your username or a machine-specific folder.
- Nothing your code writes goes into the raw folder.
- Row and column counts are printed between steps, not only at the end.
- Both outputs are written by code, not exported by hand.
- The outputs folder was actually deleted and rebuilt.
