Climate Analysis and Exploration: Note that the code will not run as I removed the google API key
This is a project to analyze the effects of latitude on climate. For the project, I created a Python script to import the weather from a random sample of 500+ cities across the world. I created scatterplots to visualize the relationship between latitude and aspects of climate, including temperature, humidity, cloudiness and wind speed. I then ran linear regressions on each relationship for both the Northern and Southern Hemispheres. Finally I created a humidity heatmap for the cities and plotted hotels that were in areas of attractive climates using google maps.
- Pandas
- Jupyter Notebook
- Time
- Google Maps API
- Matplotlib
- Scipy.stats
I first created a set of scatterplots showing the relationships between latitude and climate in terms of temperature, humidity, cloudiness and wind speed. For example the following plot shows that there is a visible linear relationship between latitude and temperature, especially for the northern hemisphere.
Next I created a set of plots showing a linear regression of the first plots to quantify the relationships more exactly. For example, this plot shows a linear regression for the relationship between max temperature and latitude in the northern hemisphere. The first two plots show the relationship between temperature and latitude. There is an evident visual correlation and the r**2 value of .62 gives a high confidence to our intuition that temperature is strongly affected by latitude.
I prefer a dry climate and I hate rain so the final question I looked at was to see which cities I might be interested in visiting based on weather conditions. The results are displayed as layered google maps; the first layer is a heat map showing the humidity for all of the cities that I investigated.
The second layer of the map shows hotels that are in cities with suitable weather conditions for my vacation. Some of the cities with a suitable climate had no hotels within 5000 meters so they have been removed.