Resample (and some other cool stuff) demo!

Looking at the Bellingham weather data, I'm going to look at the HourlyRelativeHumidity (mostly because I don't have to clean it) and resample it to examine it on a per-month level. Start by loading the data:

Here's the magic of resample in action. What's happening here?

So that's interesting! The result of a resample is a familiar GroupBy object - the same thing we get when we call groupby. That means we can't directly poke at the results (it's like a pile of multiple dataframes), but we can call pandas functions on it to aggregate each one. What's the maximum RH per month? Just call max() on the groupby result.

Average RH per month?

Want all the summary stats? describe is your tool of choice:

Of course, I can't resist any excuse I can find to make a histogram. Remember that we can loop over the results of a groupy (and therefore the results of a resample, too). So let's histogram each month. I looked up a few Seaborn tricks to make this nicer:

What the heck, now I want to know what Arizona looks like. In case the urge to look at any other cities strikes, I'm going to write a function that can be called on any city's data to generate these plots.

Revealed: Phoenix is a lot drier than Bellingham!