Skip to content

Commit

Permalink
make HW1 open-ended
Browse files Browse the repository at this point in the history
  • Loading branch information
afeld committed Jan 18, 2025
1 parent aad8d92 commit 2970358
Showing 1 changed file with 25 additions and 134 deletions.
159 changes: 25 additions & 134 deletions hw_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,145 +2,36 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Homework 1\n",
"\n",
"_[General assignment information](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments.html)_"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Coding: Exploring Trends in How People Submit 311 Requests\n",
"\n",
"Use this zipped copy of [the cleaned data created in the lecture](https://python-public-policy.afeld.me/en/{{school_slug}}/lecture_1.html#excluding-bad-records-from-the-dataframe) to complete the homework. Read it in from:\n",
"\n",
"https://storage.googleapis.com/python-public-policy2/data/311_requests_2018-19_sample_clean.csv.zip\n",
"\n",
"You will get a `DtypeWarning` - don't worry about that for now."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"solution"
]
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"# your code here"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 0\n",
"# Homework 1\n",
"\n",
"Which complaint submission method (`Open Data Channel Type`) is used most frequently, according to this dataset? Provide the count of each for comparison."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"solution"
]
},
"outputs": [],
"source": [
"# your code here"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 1\n",
"_[General assignment information](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments.html)_\n",
"\n",
"Get the count of each submission method per complaint type, sorted by complaint type."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"solution"
]
},
"outputs": [],
"source": [
"# your code here"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"***Review the results and share a sentence or two with your observations.***"
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"solution"
]
},
"source": [
"YOUR RESPONSE HERE"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 2\n",
"## Coding\n",
"\n",
"1. [Find a dataset.](https://python-public-policy.afeld.me/en/{{school_slug}}/final_project/resources.html#open-data-portals)\n",
" - It must have:\n",
" - At least one numeric column\n",
" - Between one thousand and one million rows\n",
" - If it's larger than that, you can filter it down.\n",
" - Don't spend too long on this step.\n",
"1. If there's more than one numeric column, pick one.\n",
"1. Create a new notebook.\n",
"1. Using pandas:\n",
" 1. Read in the data.\n",
" 1. Compute:\n",
" - The mean\n",
" - The median\n",
" - The mode\n",
" 1. Do a `groupby()` with an [aggregation](https://pandas.pydata.org/docs/user_guide/groupby.html#aggregation).\n",
"\n",
"Provide a simplified table that only lists the most common request submission method for each complaint type. There should be one row per complaint type, capturing the most common submission method for that complaint type."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"solution"
]
},
"outputs": [],
"source": [
"# your code here"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"***Can you provide a potential explaination for why some complaints are more frequently made via phone and mobile versus on the website?***"
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": [
"solution"
]
},
"source": [
"YOUR RESPONSE HERE"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now [turn in the assignment](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments.html).\n",
"\n",
"## Tutorials\n",
Expand Down Expand Up @@ -190,7 +81,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.11.11"
},
"mimetype": "text/x-python",
"name": "python",
Expand Down

0 comments on commit 2970358

Please sign in to comment.