Skip to content

Latest commit

 

History

History
62 lines (34 loc) · 2.42 KB

README.md

File metadata and controls

62 lines (34 loc) · 2.42 KB

Python API - What's the Weather Like?

Background

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

Now, we know what you may be thinking: "Duh. It gets hotter..."

But, if pressed, how would you prove it?

Equator

Part I - WeatherPy

In this example, I created a Python script to visualize the weather of 500+ cities across the world of varying distance from the equator. To do this, I utilized a simple Python library, the OpenWeatherMap API, to create a representative model of weather across world cities.

Scatter plots were used to showcase the following relationships:

  • Temperature (F) vs. Latitude

  • fig1

  • Humidity (%) vs. Latitude

  • fig2

  • Cloudiness (%) vs. Latitude

  • fig3

  • Wind Speed (mph) vs. Latitude

  • fig4

A Linear regression was run on each relationship. The plots in the Northern Hemisphere was greater than or equal to 0 degrees latitude and Southern Hemisphere was less than 0 degrees latitude.

  • 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

Jupyter-gmaps and the Google Places API was used for this part of the assignment.

  • Note: if you having trouble displaying the maps, try running jupyter nbextension enable --py gmaps in your environment and retry.

    heatmap

  • The DataFrame was narrowed down to find the ideal weather conditions. For example:

    • A max temperature lower than 80 degrees but higher than 70.

    • Wind speed less than 10 mph.

    • Zero cloudiness.