Table of Contents
Using Python requests, APIs, and JSON traversals, Part I of this project examines weather patterns as we approach the equator. While we intuitively know the temperature gets hotter, we will also evaluate humidity, windspeed, cloudiness, in addition to temperature, to understand how latitude affects weather. Part Two of this project will use jupyter-gmaps and the Google Places API to plan a future vacation based on the data collected in Part One. This python project was completed as a part of Georgia Tech's Data Science and Analytics boot camp.
In order to visualize the weather of 500+ cities across the world of varying distance from the equator, we will utilize citipy, a simple Python library and the OpenWeatherMap API to help create a representative model of weather across world cities.
To view the python code used to extract and transform the data, select the link below to view the full notebook.
Scatter plots illustrating relationship between temperature, humidity, cloudiness, and windspeed vs latitude. Max Temp displayed below. Select links to plots to view remaining plots:
Linear regression is run on each relationship, while also looking at cities in Northern Hemisphere (greater than or equal to 0 degrees latitude) and Southern Hemisphere (less than 0 degrees latitude). A linear regression function was created to optimize the code when creating the plots:
- Southern Hemisphere - Temperature (F) vs. Latitude
- Northern Hemisphere - Humidity (%) vs. Latitude
- Southern Hemisphere - Humidity (%) vs. Latitude
- Northern Hemisphere - Cloudiness (%) vs. Latitude
- Southern Hemisphere - Cloudiness (%) vs. Latitude
- Northern Hemisphere - Wind Speed (mph) vs. Latitude
- Southern Hemisphere - Wind Speed (mph) vs. Latitude
The Pandas libray was utilized to create dataframes to hold weather data for 500+ cities and saved as a CSV file.
Based on the weather data, jupyter-gmaps and the Google Places API are used to plan future vacations. To view the jupyter notebook for VacationPy, select the link to read the python code.
We can generate a heatmap that displays the humidity for every city plotted in Part One. The humidity level is used as the weight for the heatmap.
Narrowing down the DataFrame to find the ideal weather condition:
- Locations are filtered for a max temperature lower than 80 degrees but higher than 70, wind speed less than 10 mph, and zero cloudiness.
- For the ideal vacation, all destinations must meet the three parameters.
- Using Google Places API to find the first hotel for each city located within 5000 meters of our coordinates.
- Hotels are plotted on top of the humidity heatmap with each pin containing the Hotel Name, City, and Country.