I indulged in a series of climat analysis in the region of Hawaii
- In this section, I utilized Python and SQLAlchemy to perform climate analys and data exploration through a database.
- I implemented SQLALchemy ORM queries, Pandas, and Matplotlib in the following steps:
- Imported sqlite file and connected engine to SQLite database
- Automaped table classes to reference station and measurements later in the process
- Linked Python to the databse by creating a SQLAlchemy session
- Performed a percipitation analysis then a station analysis
- Found recent date in the dataset
- Used recent date, retrieved prevoius 12 months of precipitation data by querying the previous 12 months of data
- Selected only the DATE and PRCP values
- Loaded the query into a Pandas DataFrame, and set the index to the 'date' column
- Sorted the DataFrame values by 'date'
- Plotted the results by using the DataFrame
- Utilized Pandas to print summary statistics for the precipitation data
- Designed a query to calculate the total number of stations in the dataset.
- Designed a query to find the most-active stations(most rows): - Listed the stations and observation counts in descending order
- Designed a query that calculated the lowest, highest, aqnd average temperatures that filtered the most active station id found inthe previous query
- Designed aquery that retrieved prev 12 months of temperature observations data: - Filtered by the station that has the greatest number of observations - Queried the prev 12 months of TOBS data for that steation - Plotted the results as a histogram with bins=12
Created a Flask API based on the queries I just developed in the following steps:
- /
- Homepage
- Listed all available routes
- /api/v1.0/precipitation
- Converted the query results from my precipitation analysis to a dictionary using DATE as the key and PRCP as the value
- Returned the JSON prepresentation of the dictionary
- /api/v1.0/stations
- Returned a JSON list of stations from the dataset
- /api/v1.0/tobs
- Queried the dates and temperatures observations of the most active station from the prev year of data
- Returned a JSON list of temperature obvservations for the prev year
- /api/v1.0/ & /api/v1.0//
- Returned a JSON list of the MIN temperature, the AVERAGE temperature & the MAX temperature for a specified start or start-end range
- Calculated TMIN, TAVG, and TMAX for dates greater than or equal to the start date
- Given a start/end date, calculated TMIN, TAVG, and TMAX for the dates, inclusive