Skip to content

Use of Python requests, APIs, and JSON traversals to answer a fundamental question: "What's the weather like as we approach the equator?"

Notifications You must be signed in to change notification settings

CMDenys/python-api-weathermap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To better understand weather patterns in various cities across the world, a representative model was created using Python libraries and the OpenWeatherMap API to visualize the weather of 500+ cities across the world of varying distance from the equator.

Part I - WeatherPy

To create a list of cities, NumPy was used to create a set of random latitude and longitude combinations. Once the lat/lng coordinates were produced, citipy was used to identify the nearest city to each coordinate.

Next, a weather check on each city was conducting using a series of successive API calls. Included was a print log of each city as it was being processed (with the city number and city name).

Data was then converted into a data frame.

To visual what the data was telling us, a series of scatter plots to showcase the following relationships:

Additionally, linear regressions were run on each relationship to determine how much correlation existed between the variables. Below are a couple examples:


Part II - VacationPy

Once weather conditions for the cities across the world were found they were used to determine what the best city to vacation would be. In this section, jupyter-gmaps and the Google Places API were used.

The first step was to narrow down the data frame to those locations that matched my ideal weather conditions and drop any rows that didn't match.

Next, using the Google Places API, the first hotel for each city located within 5000 meters of my coordinates was identified.

Finally, the hotels were plotted on a humidity heatmap.

About

Use of Python requests, APIs, and JSON traversals to answer a fundamental question: "What's the weather like as we approach the equator?"

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published