Skip to content

Climate Analysis App using Python Pandas, Matplotlib, SQLAlchemy, and Flask.

Notifications You must be signed in to change notification settings

ZenAcar/SQLalchemy-Vacation-Planning-with-Climate-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Surfs Up!

An application to assist in vacation trip planning in Hawaii with climate analysis using Python (Pandas, Matplotlib), SQLAlchemy (ORM Queries) and Flask.

surfs-up.png

Step 1 - Climate Analysis and Exploration

A start date and end date are chosen (approximately 10 days in total) for the trip.

SQLAlchemy is used to connect to the sqlite database and reflect the tables into classes and a reference to those classes called Station and Measurement is saved.

Precipitation Analysis

A query is designed to retrieve the last 12 months of precipitation data and the results are plotted with Pandas.

precipitation

Station Analysis

  • Designed a query to calculate the total number of stations.

  • Designed a query to find the most active stations.

  • Design a query to retrieve the last 12 months of temperature observation data (TOBS).

station-histogram

Temperature Analysis I

  • Average temp for June : 74.94411764705882

  • Average temp for December : 71.04152933421226

  • Unpaired (independent) t-test score : -31.60372399000329 , pvalue=3.9025129038616655e-191

Temperature Analysis II

The minimum, average and maximum temperatures for the trip are calculated using the previous years temperature data for those same dates. A bar chart is plotted with the average temperature for the y value and the peak-to-peak (tmax-tmin) value as the y error bar (yerr).

temperature

Daily Rainfall Average

  • Calculate the rainfall per weather station using the previous year's matching dates.

  • Calculate the daily normals (the min, avg, and max temperatures).

daily-normals


Step 2 - Climate App

A Flask API is designed based on the queries developed as part of the initial analysis above and the following routes are created.

Routes

  • /

    • Home page that lists all the routes that are available
  • /api/v1.0/precipitation

    • Returns a JSON list of all the dates and the corresponding precipitation values
  • /api/v1.0/stations

    • Returns a JSON list of stations from the dataset
  • /api/v1.0/tobs

    • Returns a JSON list of temperature observations (TOBS) for the previous year for the most active station
  • /api/v1.0/

    • Returns a JSON list of the minimum, average and the maximum temperatures for all dates greater than and equal to the start date
  • /api/v1.0//

    • Returns a JSON list of the minimum, average and the maximum temperatures for a given date range.

app image

About

Climate Analysis App using Python Pandas, Matplotlib, SQLAlchemy, and Flask.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published