Giter VIP home page Giter VIP logo

python-api-weather's Introduction

python-api-challenge

Overview

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

Part I - WeatherPy

In this instance, create a Python script to visualize the weather of 500+ cities across the world of varying distance from the equator. To accomplish this, you'll be utilizing a simple Python library, the OpenWeatherMap API, and a little common sense to create a representative model of weather across world cities. The first requirement is to create a series of scatter plots to showcase the following relationships:

Max Temperature (F) vs. Latitude

Temperature (F) vs. Latitude

Humidity (%) vs. Latitude

Humidity (%) vs. Latitude

Cloudiness (%) vs. Latitude

Cloudiness (%) vs. Latitude

Wind Speed (mph) vs. Latitude

Wind Speed (%) vs. Latitude

The second requirement is to run linear regression on each relationship. This time, separate the plots into Northern Hemisphere (greater than or equal to 0 degrees latitude) and Southern Hemisphere (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

Final has randomly select 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. Saved a CSV of all retrieved data and a PNG image for each scatter plot.

Observations

  • One finds higher temperature at latitudes closer to the equator (0) and cooler temperatures as you increase north or south.
  • Cloudiness, Wind Speed and Humidity have weak correlation to latitude and do not appear to be effected by nearing the equator.
  • Of the weak correlations, wind speed had the lowest r values, in specific the norther hemisphere at r = 0.002

Part II - VacationPy

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

All Priot City Humidity

Narrow down the DataFrame to find your ideal weather condition.

  • A max temperature lower than 80 degrees but higher than 70.
  • Wind speed less than 10 mph.
  • Max cloudiness less than 10%.

Ideal Weather DF

Use Google Places API to find the first hotel for each city located within 5000 meters of your coordinates. Plot the hotels on top of the humidity heatmap with each pin containing the Hotel Name, City, and Country.

Desired Hotels Map

Considerations

  • The city data is generated from random coordinates (longitude and latitude). This means that the outputs will not be an exact match each time the code is run and not all cities will be encluded in all searches

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.