Giter Site home page Giter Site logo

joekimga / sqlalchemy-challenge Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 4.13 MB

An analysis that evaluates the climate and other factors in Hawaii. SQLAlchemy ORM queries, Python, Pandas, JavaScript, Matplotlib and a Flask API were used to do the analysis.

Jupyter Notebook 99.47% Python 0.53%

sqlalchemy-challenge's Introduction

SQLAlchemy Homework - Surfs Up!

surfs-up.png

Step 1 - Climate Analysis and Exploration

Python and SQLAlchemy were used to do basic climate analysis and data exploration of the Hawaiian climate database. All of the following analysis was completed using SQLAlchemy ORM queries, Pandas, and Matplotlib.

  • The starter notebook and hawaii.sqlite files were provided to complete the climate analysis and data exploration.

  • SQLAlchemy create_engine was used to connect to the sqlite database.

  • SQLAlchemy automap_base() was used to reflect tables into classes and save a reference to those classes called Station and Measurement.

  • Python was linked to the database by creating an SQLAlchemy session.

  • Important Don't forget to close out your session at the end of your notebook.

Precipitation Analysis

  • I retrieve the last 12 months of precipitation data by querying the 12 preceding months of data. Note you do not pass in the date as a variable to your query.

  • The date and prcp values were selected.

  • The query results into a Pandas DataFrame and set the index was set to the date column.

  • DataFrame values was sorted by date.

  • DataFrame plot method was used.

    precipitation

  • Pandas was used to print the summary statistics for the precipitation data.

Station Analysis

  • A query was designed to calculate the total number of stations in the dataset,

  • a query was designed to find the most active stations (i.e. which stations have the most rows?).

    • The stations and observation counts were listed in descending order.

    • The station with the highest number of observations was found.

    • Using the most active station id, the lowest, highest, and average temperature was calculated.

  • A query was designed to retrieve the last 12 months of temperature observation data (TOBS).

    station-histogram

  • Close out your session.


Step 2 - Climate App

Now that you have completed your initial analysis, design a Flask API based on the queries that you have just developed.

  • Use Flask to create your routes.

Temperature Analysis I

  • Hawaii is reputed to enjoy mild weather all year. Is there a meaningful difference between the temperature in, for example, June and December?

  • We used pandas to find the temperature difference between June and December.

Temperature Analysis II

  • Using the historical data in the dataset to find out what the temperature has previously looked like between August first to August seventh.

    temperature

Daily Rainfall Average

  • The rainfall per weather station was calculated using the previous year's matching dates.

    • The data was sorteded in descending order by precipitation amount and list the station, name, latitude, longitude, and elevation.

    daily-normals

  • Close out your session.

sqlalchemy-challenge's People

Contributors

joekimga avatar

Watchers

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