We use Python 3.6

go back Level: Advanced (img: AV / score: 4) level Bite 145. Record Breakers

2 out of 2 users completed this Bite ...
Will you be Pythonista #3 to crack this Bite?

The data for this challenge comes from a subset of The National Centers for Environmental Information (NCEI) Daily Global Historical Climatology Network (GHCN-Daily). The GHCN-Daily is comprised of daily climate records from thousands of land surface stations across the globe.

Each row in the datafile corresponds to a single observation.

The following variables are provided to you:

  • id : station identification code
  • date : date in YYYY-MM-DD format (e.g. 2012-01-24 = January 24, 2012)
  • element : indicator of element type
    • TMAX : Maximum temperature (tenths of degrees C)
    • TMIN : Minimum temperature (tenths of degrees C)
  • value : data value for element (tenths of degrees C)

For this challenge, you must:

  1. Familiarize yourself with the dataset, then separate the record high and record low temperatures by day of the year over the period 2005-2014.
  2. For the 2015 data, extract any points (highs and lows), for which the ten year record (2005-2014) record high or record low was broken in 2015.
  3. Watch out for leap days (i.e. February 29th), it is reasonable to remove these points from the dataset for the purpose of this challenge.
  4. Finally, return a tuple with a namedtuple for the highest and lowest record breaking stations that include its station ID, Date, and temperature Value in Celsius.

Complete high_low_record_breakers_for_2015 following the instructions in its docstring. Also check out the tests that have to pass.

The data you have been given is near Ann Arbor, Michigan, United States, and the stations the data comes from are shown on the map below:

Station Locations


Round of applause for @clamytoe for delivering this Bite.

Github login button