sqlalchemy-challenge
Step 1 - Climate Analysis and Exploration
-
Used Python and SQLAlchemy to do basic climate analysis and data exploration of your climate database. All of the following analysis should be completed using SQLAlchemy ORM queries, Pandas, and Matplotlib.
-
Used the provided starter notebook and hawaii.sqlite files to complete your climate analysis and data exploration.
Precipitation Analysis
-
Retrieve the last 12 months of precipitation data.
-
Selected the
date
andprcp
values. -
Loaded the query results into a Pandas DataFrame and set the index to the date column.
-
Sorted the DataFrame values by
date
. -
Plotted the results using the DataFrame
plot
method. -
Used Pandas to print the summary statistics for the precipitation data.
Station Analysis
-
Designed a query to calculate the total number of stations.
-
Designed a query to find the most active stations.
- Stations and observation counts in descending order
- Station with the highest number of observations?
-
Designed a query to retrieve the last 12 months of temperature observation data (TOBS).
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.
Routes
-
/
-
Home page.
-
List all routes that are available.
-
-
/api/v1.0/precipitation
-
Convert the query results to a dictionary using
date
as the key andprcp
as the value. -
Return the JSON representation of your dictionary.
-
-
/api/v1.0/stations
- Return a JSON list of stations from the dataset.
-
/api/v1.0/tobs
-
Query the dates and temperature observations of the most active station for the last year of data.
-
Return a JSON list of temperature observations (TOBS) for the previous year.
-
-
/api/v1.0/<start>
and/api/v1.0/<start>/<end>
-
Return a JSON list of the minimum temperature, the average temperature, and the max temperature for a given start or start-end range.
-
When given the start only, calculate
TMIN
,TAVG
, andTMAX
for all dates greater than and equal to the start date. -
When given the start and the end date, calculate the
TMIN
,TAVG
, andTMAX
for dates between the start and end date inclusive.
-
Did not do bonus