Whether financial, political, or social -- data's true power lies in its ability to answer questions definitively. I used Python requests, APIs, and JSON traversals to answer a fundamental question: "What's the weather like as we approach the equator?"
Now, we know what you may be thinking: "Duh. It gets hotter..."
But, if pressed, how would you prove it?
I created a Python script to visualize the weather of 500+ cities across the world of varying distance from the equator. To accomplish this, I used simple Python library and the OpenWeatherMap API to create a representative model of weather across world cities.
- Randomly selected at least 500 unique (non-repeat) cities based on latitude and longitude.
- Performed a weather check on each of the cities using a series of successive API calls.
- Created print log of each city as it's being processed with the city number and city name.
- Saved a CSV of all retrieved data and a PNG image for each scatter plot.
-
I created a series of scatter plots to showcase the relationships between latitude and different weather measures.
-
I ran linear regression on each relationship, on data separated into the Northern Hemisphere (greater than or equal to 0 degrees latitude) and the Southern Hemisphere (less than 0 degrees latitude)
I used jupyter-gmaps and the Google Places API (file) to:
-
Create a heat map that displays the humidity for every city from the part I.
-
Narrowed down the DataFrame to find on ideal weather condition.
-
Used Google Places API to find the first hotel for each city located within 5000 meters of your coordinates.
-
Plotted the hotels on top of the humidity heatmap with each pin containing the Hotel Name, City, and Country.


