I moved to Moscow 4 months ago and so far experienced an icredibly cold and most of the time rainy weather. As we all now Russia in general is considered as a very cold country and since is already winter I decided to use the historic weather data from the Weather Underground for Moscow to try to predict two good weather weeks in winter in order to do some sightseeing without freezing during it. Of course the weather in the winter of 2017 may be very different to 2014 but it should give me some indication of when would be a good time to make a trip in the center of Moscow.
Getting the data
Weather Underground keeps historical weather data collected in many airports around the world. Right-click on the following URL and choose ‘Open Link in New Window’ (or similar, depending on your browser):
When the new page opens start typing ‘Moscow’ in the ‘Location’ input box and when the pop up menu comes up with the option ‘Moscow, Russia Federation’ select it and then click on ‘Submit’.
When the next page opens with London Heathrow data, click on the ‘Custom’ tab and select the time period From: 1 January 2014 to: 31 December 2014 and then click on ‘Get History’. The data for that year should then be displayed further down the page.
The data can be obtained month by month in CSV format. For example, the January 2014 data is available at this URL:
where LHR is the airport code. Changing the first 1 to 2, 3, etc. will show instead the data for February, March, etc. You can also change the 2014 in the URL to another year.
The date column heading will be the timezone, e.g. ‘GMT’ (Greenwich Mean Time) for Moscow, or the time offset, e.g. ‘+02’. It may even change throughout the year. For example, Delhi (aiport code DEL) is ‘+0430’ from March to August and ‘+0330’ in the other months.
You can copy each month’s data directly from the browser to a text editor like Notepad or TextEdit, to obtain a single file with as many months as you wish.
Weather Underground has changed in the past the way it provides data and may do so again in the future.
I have therefore collated the whole 2014 data in the provided ‘Moscow_SVO_2014.csv’ file.
Now load the CSV file into a dataframe making sure that any extra spaces are skipped:
We definitely need to change the values in the 'GMT' column into values of the datetime64 date type.
We also need to change the index from the default to the datetime64 values in the 'GMT' column so that it is easier to pull out rows between particular dates and display more meaningful graphs:
Finding a week with good weather in winter to do a city trip
According to meteorologists, winter extends for the whole months of December, January, February in the northern hemisphere. Since it is already January im going to create a dataframe that holds just the months January an February using the datetime index, like this:
<matplotlib.axes._subplots.AxesSubplot at 0x7faf8d17e160>
The middle of Fabruary looks pretty good with 5 days of temperature above 0 degrees-from 12th until 16th.
The graphs have shown the volatility of a Russian winter, but a couple of weeks were found when the weather wasn’t too bad in 2014. Of course this is no guarantee that the weather pattern will repeat itself in future years. To make a sensible prediction we would need to analyse the winters for many more years.