Giter VIP home page Giter VIP logo

python-api-weather_analysis's Introduction

Python API - Finding the Best Vacation Spots


Part 1: Getting data and analyzing relationships

Utilizing Python requests, APIs, and JSON traversals to answer a fundamental question: "What's the weather like as we approach the equator?"
In order to answer this, Python script created to visualize the weather of 500+ cities across the world of varying distance from the equator. Used Python library - citipy and used request to obtain JSON from OpenWeather API

Performed the following on the JSON data:

  • Used np.random to obtain a range of random latitude and longitude to form a lists of coordinates
  • Feed the coordinates into citipy to get a list of city names
  • The city names are then used to get weather data from OpenWeatherMap
  • As there is a limit on the API key, a limiter of 50 is inplace
  • Clean the data by removing a few outliers and export to CSV
  • Plot the data and identify the correlation between Latitude and the required factors - Temperature, Humidity, Cloudiness, Wind Speed
  • Ran linear regression on each relationship and seperate into Northern and Southern Hemisphere

Sample Snippets of Plots:

See part 1's Jupyter Notebook


Part 2: Using the analysis to find the best facation spot

Used the exported CSV to plot on Google Maps and generate a heatmap displaying the humidity for every city

Narrowed down the DataFrame to get the ideal weather condition:

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

Feed the ideal locations into Google Places API to find the first hotel within 5000 meters

Pin each hotel on the map

Explore on how it is done on the Jupyter Notebook

python-api-weather_analysis's People

Contributors

foofx88 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.