Skip to content

A python project to explore weather patterns around the world and identify dream vacation location using google maps API.

Notifications You must be signed in to change notification settings

susovd/Dream-Vacation-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Dream Vacation Location

A Python API Project

Table of Contents

About The Project

Background

This project tackles the problem of weather patterns as one moves closer to equator using Python APIs. In the 2nd part, I find my ideal vacation location using data I used to analyze weather patterns.

Equator

Part I - Weather patterns around the globe

In this project, I 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 a simple Python library, the OpenWeatherMap API, and a little common sense to create a representative model of weather across world cities.

First, I created 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

Then, I ran linear regression on each relationship, only this time separating them 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

In the end, I accomplished the following:

  • Randomly select at least 500 unique (non-repeat) cities based on latitude and longitude.
  • Perform a weather check on each of the cities using a series of successive API calls.
  • Include a print log of each city as it's being processed with the city number and city name.
  • Save a CSV of all retrieved data and a PNG image for each scatter plot.

Part II - Finding ideal vacation location in the world

In this part, I use the weather data to plan future vacations. I used jupyter-gmaps and the Google Places API for this part of the assignment.

I accomplished the following with the data.

  • Create a heat map that displays the humidity for every city from the part I of the project.

    heatmap

  • Narrow down the DataFrame to find my ideal weather condition. For example:

    • A max temperature lower than 26 degrees but higher than 19.

    • Wind speed between 2-5 mph.

    • Cloudiness under 10 percent.

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

  • Using Google Places API, 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.

    hotel map

Built With

Getting Started

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

Results

Based on my data and criteria for ideal vacation weather, my ideal vacation location is Lanzhou, China.

Additional reference materials:

Best-README-Template Retrieved from: https://github.com/othneildrew/Best-README-Template

About

A python project to explore weather patterns around the world and identify dream vacation location using google maps API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published