Ever feel like the same thing happens on certain days of the week? An Alipian thought so and it created a stir at the office.
Hypothesis: It rains more in Boston on Tuesday than any day of the week.
A number of people at the office agreed, others not so sure. So we started keeping track on a white board. The date would be written down if it rained at all on a Tuesday. A few years later, people stopped questioning it and either accepted it or withheld opposition. But is it really true? Let's do a quick technology build to find out.
Steps to Solution: Pull data from an API, only save relevant data, upload to a visualization tool, shape the data, display results.
Pull data from API
The National Weather Service Forecast Office has precipitation data for Boston. They also have an API. To pull the data for the past ten years:
Google Data Studio accepts a csv and a date range control can be added to be more granular. You can also shape the data once ingested to better understand the data.
Shape the data
Import the data into Google Data Studio and add two custom fields. One converts the date to the day of the week (2 for Tuesday) and then it is further converted to a human readable day of the week (Tuesday). The other field checks to see if the precipitation is greater than 0.00 inches. If it is, it is considered to have rained on that date.
We add two bar charts on the page. One will look at the number of times it has rained in Boston, while the other looks at how much precipitation has fallen.
So what are the final results?
Over the past 10 years, Tuesday has been the rainiest day. Both in the number of occurrences and the number of inches fallen.
It took about an hour from start to finish to solve the great debate. I wonder what we will come up with next?