Skip to content

Visualization analysis of weather in 500+ cities at different latitudes relative to the equator line. The visualizations show temperature, humidity, cloudiness, wind speed using OpenWeatherMap API and Citypy module.

Notifications You must be signed in to change notification settings

mserobabina/Python_APIs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

Python_APIs

Background

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.

Objectives

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.

Observable Trends

  • 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.

Image

Generating Cities List

Image

Performing API Calls

  • 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)

Image

Converting Raw Data to DataFrame

Image Image Image Image

Plotting the Data

  • Using a proper labeling of the plots using plot titles (including date of analysis) and axes labels
  • Save the plotted figures as pngs

Latitude vs. Temperature Plot

Image

Latitude vs. Humidity Plot

Image

Latitude vs. Cloudiness Plot

Image

Latitude vs. Wind Speed Plot

Image

About

Visualization analysis of weather in 500+ cities at different latitudes relative to the equator line. The visualizations show temperature, humidity, cloudiness, wind speed using OpenWeatherMap API and Citypy module.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published