{ "cells": [ { "cell_type": "markdown", "id": "e6d8f15c-c7a7-424c-acfc-d91d7517c7a9", "metadata": {}, "source": [ "# Problem 4: \n", "## [ATM350 Homework 3](https://docs.google.com/document/d/1LakRQQE3ORtRqUrKRTJa7IZy93uLa2qe37AUMpY0v68/edit), Spring 2023\n", "```\n", "The website, xmACIS2, is a great archive for text-based weather data, climatology, records, etc. For this problem, you will be retrieving data relevant to your final project case study.\n", "First, create a problem4 directory and cd into it.\n", "Then, complete the following tasks:\n", "```" ] }, { "cell_type": "markdown", "id": "923eab89-e3cb-476e-8e3f-46886c31964a", "metadata": {}, "source": [ "### Part a:\n", "```\n", "Copy the notebook, /spare11/atm350/common/hwdata/hw3/Xmacis.ipynb into this directory.\n", "```" ] }, { "cell_type": "markdown", "id": "874c6063-9475-40a4-9600-e6cde7d3e794", "metadata": {}, "source": [ "### Part b:\n", "```\n", "Modify the notebook as guided by the four Tasks. Choose a site and a time period (at least one week, no greater than one month) to retrieve data relevant for your case study.\n", "```" ] }, { "cell_type": "markdown", "id": "92881b91-2e99-4a69-bc8a-29f3a19cf645", "metadata": {}, "source": [ "### Part c:\n", "```\n", "Run the notebook to its completion.\n", "```" ] }, { "cell_type": "markdown", "id": "70ea47d3-d1ad-45df-893f-a637fa149667", "metadata": {}, "source": [ "### Part d:\n", "```\n", "Use Pandas and Matplotlib to create the following time-series plots:\n", " 1. Max / min temps (deg. C)\n", " 2. Daily precip (units of mm) (or, if relevant for your case, daily snowfall)\n", "```" ] }, { "cell_type": "markdown", "id": "b5608598-a741-4af7-991f-ba41dfaca4f6", "metadata": {}, "source": [ "### Imports" ] }, { "cell_type": "code", "execution_count": 1, "id": "c254db06-d3f5-4113-800d-951f84deb45f", "metadata": { "tags": [] }, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 2, "id": "d5a4e958-04f3-4e24-a317-097c86548ff3", "metadata": { "tags": [] }, "outputs": [], "source": [ "csvFile = 'climo_alb_930310_930316.csv'" ] }, { "cell_type": "markdown", "id": "ae0854e7-8172-4b75-bdff-24639a20396e", "metadata": {}, "source": [ "#### Read the file into a Pandas `Dataframe`" ] }, { "cell_type": "code", "execution_count": 12, "id": "c6d626ea-3e13-4f46-89e6-7069cdd65021", "metadata": { "tags": [] }, "outputs": [], "source": [ "df = pd.read_csv(csvFile, dtype='string')" ] }, { "cell_type": "markdown", "id": "b72bca73-7472-4cc5-8f37-aca6e4adc167", "metadata": { "tags": [] }, "source": [ "Examine the `Dataframe`" ] }, { "cell_type": "code", "execution_count": 13, "id": "72c4196c-b677-4243-b790-b85f6106d043", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", " | DATE | \n", "MAX | \n", "MIN | \n", "AVG | \n", "DEP | \n", "HDD | \n", "CDD | \n", "PCP | \n", "SNW | \n", "DPT | \n", "
---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1993-03-10 | \n", "38 | \n", "25 | \n", "31.5 | \n", "-2.1 | \n", "33 | \n", "0 | \n", "0.16 | \n", "3.1 | \n", "2 | \n", "
1 | \n", "1993-03-11 | \n", "33 | \n", "25 | \n", "29.0 | \n", "-4.9 | \n", "36 | \n", "0 | \n", "0.08 | \n", "1.4 | \n", "6 | \n", "
2 | \n", "1993-03-12 | \n", "26 | \n", "10 | \n", "18.0 | \n", "-16.2 | \n", "47 | \n", "0 | \n", "T | \n", "0.2 | \n", "5 | \n", "
3 | \n", "1993-03-13 | \n", "21 | \n", "16 | \n", "18.5 | \n", "-16.0 | \n", "46 | \n", "0 | \n", "1.59 | \n", "22.0 | \n", "M | \n", "
4 | \n", "1993-03-14 | \n", "20 | \n", "11 | \n", "15.5 | \n", "-19.4 | \n", "49 | \n", "0 | \n", "0.24 | \n", "4.6 | \n", "28 | \n", "
5 | \n", "1993-03-15 | \n", "27 | \n", "1 | \n", "14.0 | \n", "-21.2 | \n", "51 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "27 | \n", "
6 | \n", "1993-03-16 | \n", "43 | \n", "17 | \n", "30.0 | \n", "-5.6 | \n", "35 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "27 | \n", "