Paul's Python CoursePPC

Project 2 of 9, for Yahya

Weather Data Investigation

Yahya's challenge: one question put to 150 years of real Met Office readings from Stornoway, and answered honestly. Loaded, checked, charted and written up.

About 20 hours, in 9 steps.

Sign up free to open itLog in

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

The brief

  • YahyaThe weather station outside the Archive only goes back a few years, but Stornoway's goes back to 1873.
  • YahyaAsk it one question, and answer it so well that someone who disagrees with you would still believe it.
  • CaitlinIs it getting rainier? I'll have it by lunch.
  • YahyaYou'll have an answer by lunch, that's what worries me.

stornowaydata.txt is the Met Office's monthly record for Stornoway Airport, on the Isle of Lewis, from July 1873 to September 2026: for each month, the mean daily maximum and minimum temperatures, the days of air frost, the rainfall and the hours of sunshine. It's exactly as the Met Office publishes it, marks and all, and SOURCE.md says where it came from and what each mark means.

The data is Crown copyright, from the Met Office, used under the Open Government Licence v3.0. Anything you publish from it carries this line: "Contains public sector information licensed under the Open Government Licence v3.0. Source: Met Office."

  1. Load it. station.py reads the file into an agreed table, keeping the marks as columns. The Make step checks it.
  2. Ask one question the data can answer, and plan your checks before you see the answer.
  3. Clean and check. Your own tests, in test_station.py, on everything your answer stands on.
  4. Analyse it, and chart it honestly, in investigation.py.
  5. Write it up: the answer, how sure you are, and what this data can't tell anyone.
What it prints
>>> station = load_station("stornowaydata.txt")
>>> station.shape
(1839, 10)
>>> station[["year", "month", "rain", "sun", "sun_sensor", "provisional"]].tail(2)
      year  month   rain   sun  sun_sensor  provisional
1837  2026      8  104.8  95.6        True         True
1838  2026      9  140.6  94.0        True         True

What you learn

What's in it

  1. Where the numbers came from
  2. A gap is not a zero
  3. Load the station
  4. Milestone 1: the question and the plan
  5. Milestone 2: the cleaned data, checked
  6. Milestone 3: the analysis, and honest charts
  7. Milestone 4: the write-up
  8. Ship it