Giter Site home page Giter Site logo

api-challenge-python's Introduction

Python API Challenge

Overview

This repository contains two Python scripts: WeatherPy.ipynb and VacationPy.ipynb.

Part I - WeatherPy

This Python script visualizes the weather of 500+ cities across the world of varying distance from the equator. It utilizes citipy, a simple Python library, and the OpenWeatherMap API, to create a representative model of weather across world cities.

To start, I randomly select at least 500 unique (non-repeat) cities based on latitude and longitude. Then I perform a weather check on each of the cities using a series of successive API calls. At the end, I print logs of each city as it's being processed with the city number and city name.

After gathering the data, I display a series of scatter plots to showcase the following relationships:

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

After each plot I explain what the code is and analyze each relationship.

Next, I ran a linear regression on each relationship, only this time separating them into Northern Hemisphere cities (greater than or equal to 0 degrees latitude) and Southern Hemisphere cities (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

After each pair of plots I explain what the linear regression is modeling such as any relationships I noticed and any other analysis I saw.

For all of the scatter plots above, I save a CSV of all retrieved data and a PNG image for each scatter plot. These PNG images are all located in the Output_Data folder for WeatherPy.

Part II - VacationPy

This script works with weather data to plan future vacations and uses jupyter-gmaps and the Google Places API.

  • Creates a heat map that displays the humidity for every city from WeatherPy

  • Narrows down the DataFrame to find cities with the following weather conditions:

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

    • Wind speed less than 5 mph.

    • Cloudiness less than 5.0.

    • Drop any rows that don't contain all three conditions.

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

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

Located within the Output_Data folder in VacationPy is a screenshot of the final map figure.

api-challenge-python's People

Contributors

doublealogic avatar

Watchers

 avatar

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.