Paul's Python CoursePPC

Project 12 of 12, for Yahya

Data Story

The Act V capstone: a data story. A century of the station book cleaned once, summed up honestly, drawn fairly, written up and published as a web page; then a story of your own, from a public dataset of your choice.

About 10 hours, in 18 steps.

Sign up free to open itLog in

Act 5 needs a free account, so your work is saved as you go. Act 1 is open to everyone.

The brief

  • YahyaThis is a hundred years of the Clocktower's station book, and I want it read properly, once, and written up.
  • YahyaI want what changed, how sure we are and what didn't change, because that last part always gets left out.
  • YahyaThe ledger's just as the volunteers typed it, in Fahrenheit until 1960 and with some pages in twice.
  • PaulDo it as four files with one job each, then the words, and then a page anyone can open.

ledger.csv is the station book as it was typed: one row per month from 1925 to 2024, with the month, the temperature and the unit it was written in, the rain in millimetres and the hours of sunshine.

Build the report in four files. Each one's requirements are at the top of it.

  1. station.py cleans the ledger: one unit, real numbers, each month once, in order.
  2. summary.py works out the numbers: each year, each decade, the 1961 to 1990 normals, the warming trend, and a permutation test of the last thirty years against the first thirty.
  3. charts.py draws three honest charts: the temperature as a difference from the 1961 to 1990 average, the rain by decade, and both thirty-year periods month by month.
  4. report.py prints the report and draws the charts, ending with your own conclusion.
  5. page.py turns the report into a web page, story.html, with the charts inside it, and report.py writes it from the same lines it prints.

Then Yahya reads it against his checklist. Last of all, tell a data story of your own: a question, a public dataset of your choice that can answer it, the same pieces, and a page published online.

What it prints
The Clocktower Weather Report, 1925 to 2024
Source: Clocktower weather station book, 1925 to 2024, in the Archive

The record
  1200 months, missing months: none
  Warmest year: 2022 (12.99 degrees C). Coldest: 1963 (9.84 degrees C)
  Wettest year: 1960 (1439 mm). Driest: 1982 (798 mm)

Then and now: 1995 to 2024 against 1925 to 1954
  Temperature: +0.86 degrees C (p < 0.001)
  Rain: -35 mm a year (p = 0.21)
  Sunshine: +26 hours a year (p = 0.43)
  Warming over the century: 0.13 degrees C a decade
  Warmed most on the 1961 to 1990 normal: June, +1.50 degrees C

Conclusion
  ...

What's in it

  1. Mark it out first
  2. Keep it, or take it from elsewhere
  3. No negative rain
  4. The station book, cleaned
  5. A straight line through the years
  6. Slope first
  7. The numbers
  8. The charts
  9. Yahya reads Caitlin's draft
  10. The report
  11. Pictures inside a page
  12. There and back
  13. The story as a web page
  14. Milestone: Yahya's checklist
  15. A story of your own
  16. Milestone: your own data story
  17. Ship it