June 2017
Beginner to intermediate
296 pages
7h 4m
English
Given that everything in our RDD consists of TMIN, we don't really need that TMIN any more, so we can strip those out now. We're going to apply a new map function to our RDD that does exactly that:
stationTemps = minTemps.map(lambda x: (x[0], x[2]))
So we're going to transform every composite value to a new one that just consists of two values, which is the station ID and the temperature:
(lambda x: (x[0], x[2]))
At this point, we have a key/value pair in our new stationTemps RDD. Since we're down to just two values, our key is the station ID and the value is the temperature observed, which again at this point is in Fahrenheit. So now for every day of the year, we have a minimum temperature ...
Read now
Unlock full access