Skip to content

Analysis of world weather data obtained from the OpenWeather API. Packages used include Citipy, Requests, Pandas and Matplotlib.

Notifications You must be signed in to change notification settings

ejw-data/pandas-weather-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pandas-weather-analysis

Author: Erin James Wills, ejw.data@gmail.com

Photo by Greg Rosenke on Unsplash


Overview


Analysis of humidity, temperature, cloudiness, and precipation data from over 1000 randomly selected cities from around the world. Randomly selected cities were obtained by using the citipy package and weather data for each city was obtained from API calls to OpenWeather. Analysis was performed by using Pandas and Matplotlib.


Technologies

  • Python
  • Pandas
  • Matplotlib
  • Requests

Data Source

Dataset generated within the notebook. The cities used in this analysis were randomly generated by using the citypy package. The weather data was generated by using the OpenWeather API. A free API key is needed to use this service.


Setup and Installation

  1. Environment needs the following:
    • Python 3.6+
    • pandas
    • matplotlib.pyplot
    • numpy
    • requests
    • time
    • citipy
  2. Activate your environment
  3. Clone the repo to your local machine
  4. Obtain a free API key from OpenWeatherMap by creating an account.
  5. Add the key to config.py. Ensure that quotes are not deleted in this file. The API key is used as a string.
  6. Start Jupyter Notebook within the environment from the repo
  7. Run WeatherPy.ipynb
  8. Note: If the notebook says it can not find the file for the API Key then ensure you have entered your api key in config.py and have saved the file. Next, restart the kernel and retry.

Analysis

Note: Additional images can be found in the output_data folder. Each time the notebook is run in it's entirety, the images are replaced with updated images.

  1. The distribution of temperatures by latitude makes a somewhat symetrical distribution. This makes sense since the northern and southern hemispheres are on opposite seasons.

  2. The warmest regions should be between 20 to -20 degrees latitude year round since this is where the sun rays have the shortest path (based on the time of year/tilt of the earth). Everything is shifted right because we are at the end of the summer period.

  3. Other trends are difficult to discern; wind speed might be higher in the northern hemisphere and this could be due to the higher temperature and the wind is generated based on temperature/evaporation rates. Cloudiness seems to be much more likely to be 0 or 100% than the other options. Humidity seems to be influenced by temperature as expected.

  4. Below is an example image generated from the notebook.

OpenWeather API Requests

Fig.1 - Scatter Plot showing Temperature versus Latitude

Note: I should update the chart title to be dynamic and insert the date of when the chart was generated. I realized recently that it is hard coded.

About

Analysis of world weather data obtained from the OpenWeather API. Packages used include Citipy, Requests, Pandas and Matplotlib.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published