Project 8 of 12, for Yahya
Summary Statistics Report
A summary statistics report on the Clocktower station's 2024, for the summary sheet in the Archive: the middle day, the usual day, the spread and the readings that don't fit.
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
- YahyaThe station's summary sheet does the whole year in one line, and it says average daily rain is 2.6 millimetres.
- YahyaMost days it didn't rain at all, so that average day never actually happened.
- PaulThen give it more than one number.
- YahyaLet's give it six and say which is which, and find me the readings that don't belong while we're at it.
daily.csv is the Clocktower station's 2024, one row per day: date, rain (mm), temp (degrees C) and thornby, the temperature at Thornby's station, twenty miles out of the city.
Write four functions. Each takes a Series of readings and leaves it as it was.
summary(values): a dictionary with the keysmean,median,mode(the most common value; the smallest, if several tie),std(the standard deviation, as pandas works it out),q1andq3(the quartiles: a quarter of the readings are at or belowq1, three quarters at or belowq3).fences(values): the low and high fences, as a pair:q1minus one and a half timesq3 - q1, andq3plus the same.outliers(values): the readings below the low fence or above the high one, as a Series that keeps their labels.dry_days(rain, threshold=0.2): how many days had less rain than the threshold.
Rain on an average day: 2.6 mm. On the middle day: 0.3 mm. Most common: 0.0 mm. Dry days: 160 of 366 Clocktower: average 12.7 degrees C, standard deviation 4.3 Thornby: average 12.7 degrees C, standard deviation 6.3 Outside the fences: Clocktower, 2024-06-14: 41.3 degrees C Thornby: 0 readings Rain: 38 days
What you learn
What's in it
- Three kinds of average
- An average week
- How far from the middle
- Two kinds of spread
- Quarters of the pile
- A quarter of the way up
- The shape of a year
- One long wait
- A year, day by day
- Readings that don't fit
- Outside the fences
- How Paul would do it
- Make the summary sheet's numbers
- Ship it