{ "cells": [ { "cell_type": "markdown", "id": "1b022fcc-5ffa-476f-95dc-eb07327f57ff", "metadata": {}, "source": [ "# Problem 2: \n", "## [ATM350 Homework 3](https://docs.google.com/document/d/1LakRQQE3ORtRqUrKRTJa7IZy93uLa2qe37AUMpY0v68/edit), Spring 2023\n", "```\n", "Create a notebook, q2.ipynb that analyzes and visualizes Albany climate data from 2022, using the same file used in class during the Pandas lectures.\n", "```" ] }, { "cell_type": "markdown", "id": "ed87b4eb-385d-41f6-b3c5-742edb66a747", "metadata": {}, "source": [ "#### Imports" ] }, { "cell_type": "code", "execution_count": 1, "id": "43455241-af51-4511-8f43-9886c4b733ac", "metadata": { "tags": [] }, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns" ] }, { "cell_type": "code", "execution_count": 2, "id": "16cafaa2-2570-4d35-8f67-b379ee6055ed", "metadata": { "tags": [] }, "outputs": [], "source": [ "file = '/spare11/atm350/common/data/climo_alb_2022.csv'" ] }, { "cell_type": "markdown", "id": "9f40e110-9426-4693-83f5-019e99124edf", "metadata": {}, "source": [ "#### Read in the file. Specify that each column's values should be read in as strings." ] }, { "cell_type": "code", "execution_count": 3, "id": "a804d8e7-95f3-41c2-ba51-f88a9aa16c9c", "metadata": { "tags": [] }, "outputs": [], "source": [ "df = pd.read_csv(file, dtype='string') " ] }, { "cell_type": "markdown", "id": "0b25310d-15bd-4e5a-a2b1-eb9ed6d86b88", "metadata": {}, "source": [ "Examine the `Dataframe`" ] }, { "cell_type": "code", "execution_count": 4, "id": "84aee70c-a752-4fb9-b212-7b775ed55d1a", "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", "2022-01-01 | \n", "51 | \n", "41 | \n", "46.0 | \n", "19.7 | \n", "19 | \n", "0 | \n", "0.12 | \n", "0.0 | \n", "0 | \n", "
1 | \n", "2022-01-02 | \n", "49 | \n", "23 | \n", "36.0 | \n", "9.9 | \n", "29 | \n", "0 | \n", "0.07 | \n", "0.2 | \n", "0 | \n", "
2 | \n", "2022-01-03 | \n", "23 | \n", "13 | \n", "18.0 | \n", "-7.9 | \n", "47 | \n", "0 | \n", "T | \n", "T | \n", "T | \n", "
3 | \n", "2022-01-04 | \n", "29 | \n", "10 | \n", "19.5 | \n", "-6.2 | \n", "45 | \n", "0 | \n", "T | \n", "0.1 | \n", "T | \n", "
4 | \n", "2022-01-05 | \n", "38 | \n", "28 | \n", "33.0 | \n", "7.5 | \n", "32 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "T | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
360 | \n", "2022-12-27 | \n", "34 | \n", "22 | \n", "28.0 | \n", "0.6 | \n", "37 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "T | \n", "
361 | \n", "2022-12-28 | \n", "41 | \n", "22 | \n", "31.5 | \n", "4.3 | \n", "33 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "T | \n", "
362 | \n", "2022-12-29 | \n", "48 | \n", "22 | \n", "35.0 | \n", "8.1 | \n", "30 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "T | \n", "
363 | \n", "2022-12-30 | \n", "57 | \n", "43 | \n", "50.0 | \n", "23.3 | \n", "15 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "0 | \n", "
364 | \n", "2022-12-31 | \n", "53 | \n", "44 | \n", "48.5 | \n", "22.0 | \n", "16 | \n", "0 | \n", "0.08 | \n", "0.0 | \n", "0 | \n", "
365 rows × 10 columns
\n", "