Creating a Python script
to visualize the weather of 500+ cities across the world of varying distance from the equator using CityPy, a simple Python library, and the OpenWeatherMap API.
Building a series of scatter plots to showcase the following relationships:
- Temperature (F) vs. Latitude
- Humidity (%) vs. Latitude
- Cloudiness (%) vs. Latitude
- Wind Speed (mph) vs. Latitude
A Python script accomplishes the following:
- Randomly selects at least 500 unique (non-repeat) cities based on latitude and longitude.
- Performs a weather check on each of the cities using a series of successive
API calls
. - Includes a print log of each city as it's being processed with the city number and city name.
- Saves both a CSV of all data retrieved and png images for each scatter plot.
- Not surprisingly, temperature increases as we approach the equator. However, temperature peaks at around 20 degrees latitude, not exactly at the equatorial line. This may be due to the Earth's tilt in the axis known as obliquity.
- Cloudiness and humidity do not show a strong correlation to latitude. The visualizations below show a great variety of values at similar latitudes.
- Wind speed appears to slightly increase as we move away from the equator. We would need to go beyond the ranged examined to make a definitive conclusion.
- Performing a weather check on each city using a series of successive API calls
- Including a print log of each city as it's being processed (with the city number and city name)
- Exporting the city data into a weather_data.csv
- Displaying the DataFrame
- Using a proper labeling of the plots using plot titles (including date of analysis) and axes labels
- Save the plotted figures as pngs