Skip to content

Collect and analyze weather data to recommend ideal hotels based on clients’ weather preferences.

Notifications You must be signed in to change notification settings

susiexia/World_Weather_Analysis

Repository files navigation

World_Weather_Analysis

Use google maps API and OpenWeather API to create heatmaps and pop-up location markers for hotels within a certain radius of the cities where our customers travel.

Basic Project Plan

  1. Task: Collect and analyze weather data across cities worldwide.
  2. Purpose: Use the data to recommend ideal hotels based on clients’ weather preferences.
  3. Method: Create a Pandas DataFrame with 500 or more of the world’s unique cities and their weather data in real time. This process will entail collecting, analyzing, and visualizing the data.

Main Stages

  1. Collect the Data
  • Use the NumPy module to generate more than 1,500 random latitudes and longitudes.

  • Use the citipy module to list the nearest city to the latitudes and longitudes.

  • Use the OpenWeatherMap API to request the current weather data from each unique city.

  • Parse the JSON data from the API request.

  1. Exploratory Analysis with Visualization
  • Create scatter plots and linear regression of the weather data and determine the correlations.

  • Create a series of heatmaps using the Google Maps and Places API.

  1. Visualize Travel Data

Create a heatmap with pop-up markers that can display information on specific cities based on a customer’s travel preferences.

Challenge

Background

Add the amount of rainfall or snowfall within the last three hours so that customers can filter the DataFrame based on the temperature range and whether or not it is raining or snowing. Create a directions layer Google map that shows the directions between multiple cities for travel.

Process

1. Get the Weather Description and Amount of Precipitation for Each City.

2. Have Customers Narrow Their Travel Searches Based on Temperature and Precipitation.

3. Create a Travel Itinerary with a Corresponding Map.

  • Jupyter Notebook: Vacation_Itinerary.ipynb

  • The route between four cities from the customer’s possible travel destinations: WeatherPy_travel_map.PNG

  • Map with pop-up markers for the four cities: WeatherPy_travel_map_markers.PNG

Statistical Conclusion

  1. Latitude versus temperature Fig1.png Northern Humisphere Southern Humisphere

  2. Latitude versus humidity Fig2.png Northern Humisphere Linear Regression as well as Southern Humisphere Linear Regression

  3. Latitude versus cloudiness Fig3.png Northern Humisphere Linear Regression as well as Southern Humisphere Linear Regression

  4. Latitude versus wind speed Fig4.png Northern Humisphere Linear Regression Southern Humisphere Linear Regression

In conclusion, the correlation between the latitude and Max Temperature is strong because the r-value is more than 0.7 (Southern humisphere) and less than -0.7 (Northern humisphere) for the plots shown here. This means that max temperature is predictable and equator has highest temperature. Besides the max temperature, the correlation between the latitude and humidity, cloudiness and wind speed are weak, which means those weather metrics are not predicted by latitude changing