And this time I have Beautiful Soup . I recently received a copy of ‘Visualize This’ by Nathan Yau and I have been working through his example of scraping data off the interwebs (Weather Underground in this case) with Beautiful Soup. And IT is AWESOME! I love the power of going through tons of different web pages (365 in this case) and pulling out just the info that I want. Oh how awesomely cool!! To showcase my enthusiasm I have added some of my preliminary graphs of weather data for Wellington and Dunedin.

The weather data shows quite clearly how temperate New Zealand is. Mean temperatures in Wellington in the middle of summer (a.k.a January/February) span almost 10 degrees. The lowest mean temperature Dunedin received in 2010 was 0 C while Wellington was around 6 C. Of course, this data only plots mean temperature which indicates the minimum temperature reached during that day could be even lower. In both cities, the lowest mean temperature occurred around the end of July. What does this mean?: the temperature will most likely be on the upturn from now on. Woot!

But before I erupt with a gush of enthusiastic rambling about summer, I will say this: there is some weirdness with the data from Weather Underground. For example, the second plot which shows wind speed with mean temperature looks kinda odd. The wind speed in Dunedin has these huge jumps which are likely due to coarse data. I don’t know what causes this. Perhaps that particular wind station is not very sensitive or maybe it is something else entirely.

Advertisement