So I decided to treat myself to a long holiday vacation in Honolulu, Hawaii! To help with my trip planning, I need to do some climate analysis on the area. The following outlines what I need to do.
To begin, I used Python and SQLAlchemy to do basic climate analysis and data exploration of the climate database I found.
-
Chose a start date and end date for the trip. The vacation range is approximately 3-15 days total.
-
Used SQLAlchemy
create_engine
to connect to the sqlite database. -
Used SQLAlchemy
automap_base()
to reflect the tables into classes and save a reference to those classes calledStation
andMeasurement
.
-
Designed a query to retrieve the last 12 months of precipitation data.
-
Selected only 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.
-
Designed a query to calculate the total number of stations.
-
Designed a query to find the most active stations.
-
Designed a query to retrieve the last 12 months of temperature observation data (tobs).
-
Hawaii is reputed to enjoy mild weather all year. Was interested in knowing if there is a meaningful difference between the temperature in, for example, June and December?
-
Identified the average temperature in June at all stations across all available years in the dataset. Do the same for December temperature.
-
Used t-test to determine whether the difference in the means, if any, is statistically significant.
After completing my initial analysis, I designed a Flask API based on the queries that I have just developed.
- Used FLASK to create my routes.
-
/
-
/api/v1.0/precipitation
-
/api/v1.0/stations
-
/api/v1.0/tobs
-
/api/v1.0/<start>
-
/api/v1.0/<start>/<end>