-
-
Notifications
You must be signed in to change notification settings - Fork 382
Worked example of working with climate data (wrap-up to novice Python lesson) #382
Conversation
left_data = get_country_temperatures(left_country) | ||
right_data = get_country_temperatures(right_country) | ||
result = [] | ||
for ( (left_year, left_value), (right_year, right_value) ) in zip(canada, brazil): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should probably be
for ( (left_year, left_value), (right_year, right_value) ) in zip(left_country, right_country):
I like the example. It shows combining importing modules, fetching data, parsing data, writing functions and unit tests. Why not add some plotting? For example, the temperatures over time for the two countries? Makes for a more appealing example, imho... |
Looks good, comments below all minor things. Possible typos: I wonder if there are more intuitive names than "reader" and "wrapper": instead of Re: left and right in section 5/6: I haven't seen it done with this syntax before (I would probably just use x1 and x2, or something) but maybe that's just me. Is there any dnager of left/right here being confused with other things, like the left-most characters in a string, etc? Minor wording changes which I think help clarify: "Escape sequences" box: important info but I think it disrupts the flow a bit. |
Worked example of working with climate data (wrap-up to novice Python lesson)
This PR contains a capstone lesson for the novice Python material that shows how to use
requests
,cStringIO
,csv
, and the World Bank's Climate Data API to download data from the web and do some simple analysis with it.