Skip to content

Pull data from APIs like GooglePlaces and OpenWeatherMaps

Notifications You must be signed in to change notification settings

danawoodruff/Python-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python API Challenge - What's the Weather Like?

Background

Whether financial, political, or social -- data's true power lies in its ability to answer questions definitively. So let's take what you've learned about Python requests, APIs, and JSON traversals to answer a fundamental question: "What's the weather like as we approach the equator?"

Part I - WeatherPy

Created a Python script to visualize the weather of 500+ cities across the world of varying distance from the equator. To accomplish this, I utilized (https://pypi.python.org/pypi/citipy) and the OpenWeatherMap API, and a little common sense to create a representative model of weather across world cities.

Then a series of scatter plots with color bars to showcase the following relationships:

  • Temperature (F) vs. Latitude
  • Humidity (%) vs. Latitude
  • Cloudiness (%) vs. Latitude
  • Wind Speed (mph) vs. Latitude

Then a linear regression was run on each Northern Hemisphere (greater than or equal to 0 degrees latitude) and Southern Hemisphere (less than 0 degrees latitude)relationship.:

  • Northern Hemisphere - Temperature (F) vs. Latitude
  • Southern Hemisphere - Temperature (F) vs. Latitude
  • Northern Hemisphere - Humidity (%) vs. Latitude
  • Southern Hemisphere - Humidity (%) vs. Latitude
  • Northern Hemisphere - Cloudiness (%) vs. Latitude
  • Southern Hemisphere - Cloudiness (%) vs. Latitude
  • Northern Hemisphere - Wind Speed (mph) vs. Latitude
  • Southern Hemisphere - Wind Speed (mph) vs. Latitude

Part II - VacationPy

  • Created a heat map that displays the humidity for every city from Part I.

  • Narrowed down the DataFrame to find appx ten cities with ideal weather conditions:

  • A max temperature lower than 77 degrees but higher than 68.

  • Wind speed less than 10 mph.

  • Zero cloudiness.

  • Used Google Places API to find the first hotel for each city located within 5000 meters of the coordinates.

  • Plot the hotels on top of the humidity heatmap with each pin containing the Hotel Name, City, and Country.

About

Pull data from APIs like GooglePlaces and OpenWeatherMaps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published