Back to Posts

Picnic in San Francisco

Posted in applications, data-mining, scraping

My beloved SF Tsunami Master Team had planned a great picnic for this week end. Just like the year before the plan had to be canceled due to inclement weather: pouring rain throught the whole weekend.

I admit I sneered at the idea of having the picnic the same month as last year, considering that it got canceled once. However, forming opinions based on a sample size of two with a sprinkle of gut feeling on top is not the way a Scientist does things, so I thought it would be interesting and constructive to pull some data to validate or disprove my prejudice and to provide a valid alternative.

My hypothesis is quite simple: in April chances of rain are way higher than in May, while temperatures are pretty constant, so the latter would be a better option to plan outdoor activities.

With a quick Google search I ran into this site which reports monthly and daily information about temperature and precipitations.

The format is quite easy to scrape. The data I’m interested in are the monthly average temperatures and the number of rainy days per month. For more about how I gathered the data checkout the source.

So, it turns out that the data confirms my hypothesis that having a picnic in SF in April is probably not the best idea if you want to frolic in the Sun, while your chances of having a successful event in May are almost three times higher!. In the figure below we can see how April has a 23% chances of rain, basically one day out of 4. We can have better conditions than in April as late as November, and yet I doubt people would consider reasonable to organize a picnic in November.

png

Daily Chances of Rain
Jan 27.741935
Feb 31.428571
Mar 32.580645
Apr 23.666667
May 8.709677
Jun 5.416667
Jul 4.193548
Aug 3.548387
Sep 3.666667
Oct 13.870968
Nov 24.333333
Dec 33.870968

The takehome message should be:

  • April is too soon to plan a picnic
  • May is quite dry
  • SF’s weather is good enough to allow you to hang out outside as late as November!

source

Data Scientist. Born and raised in Italy. Marathon Swimmer.

Read Next

The Catalina Men