A Notebook That Tells a Story
An analysis is finished when someone else can follow it. Using a community center's class sign-ups, shape a notebook into a report: the question, the short answer, the evidence and what the data can't show, with tables people can read, then share it as a web page.
Updated
Telling the Story
- A Notebook That Tells a Story (Journeyman): A report notebook leads its reader from a title and the question to the short answer first, then the evidence, how it was done and what the data can't show, written in Markdown cells with headings, lists, bold and tables, and kept apart from the notebook you explored in.
- Tables People Can Read (Journeyman): A table in a report keeps only the columns a reader needs, renames them in plain words, rounds its numbers, shows the top ten instead of every row, and uses df.style.format to show money as $20.00 and shares as 97.2% with the index hidden.
- What the Data Can and Can't Show (Journeyman): Two things moving together doesn't show one causes the other, a rate from a few sessions swings far more than one from many, and the period covered and the rows left out limit every finding, so a report ends with a short What this data can't tell us section that names them.
Sharing a Notebook
- Sharing a Notebook as a Web Page (Journeyman): Run Restart and Run All, then turn the notebook into a web page anyone can open with jupyter nbconvert --to html, add --no-input to hide the code from readers who don't want it, or use VS Code's Export, which runs nbconvert too; PDF needs extra programs, and a notebook's saved outputs make its Git history noisy, so readers get the HTML.
Exercise: Community Center Story
- Exercise: Community Center Story (Journeyman): Write four tested functions that find which classes fill up, the busiest month, the no-show rate and the categories too small to trust at a community center, then tell the story in a notebook under four set headings, run it from a fresh start, and let pytest read the saved notebook.