|
12 | 12 | "source": [ |
13 | 13 | "# Homework 2\n", |
14 | 14 | "\n", |
15 | | - "_[General assignment information](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments.html)_" |
| 15 | + "_[General assignment information](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments.html)_\n" |
16 | 16 | ] |
17 | 17 | }, |
18 | 18 | { |
|
23 | 23 | "\n", |
24 | 24 | "- [`merge()`](https://pandas.pydata.org/docs/user_guide/merging.html#merge)\n", |
25 | 25 | "- [How to manipulate textual data](https://pandas.pydata.org/docs/getting_started/intro_tutorials/10_text_data.html)\n", |
26 | | - "- [How to create new columns derived from existing columns](https://pandas.pydata.org/docs/getting_started/intro_tutorials/05_add_columns.html)" |
| 26 | + "- [How to create new columns derived from existing columns](https://pandas.pydata.org/docs/getting_started/intro_tutorials/05_add_columns.html)\n" |
27 | 27 | ] |
28 | 28 | }, |
29 | 29 | { |
|
32 | 32 | "source": [ |
33 | 33 | "## Coding\n", |
34 | 34 | "\n", |
35 | | - "The goal here is to practice joining datasets through pandas. Hint: The instructions here are intentionally incomplete." |
| 35 | + "The goal here is to practice joining datasets through pandas. Hint: The instructions here are intentionally incomplete.\n" |
36 | 36 | ] |
37 | 37 | }, |
38 | 38 | { |
|
51 | 51 | "\n", |
52 | 52 | "- Use [Scout](https://scoutopendata.com/explore/NYC) to filter by column name.\n", |
53 | 53 | "- Don't spend too long on this step.\n", |
54 | | - "- [Keep the dataset small](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments/open_ended.html#reducing-data-size) (under 500,000-ish rows) to make it easier to work with." |
| 54 | + "- [Keep the dataset small](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments/open_ended.html#reducing-data-size) (under 500,000-ish rows) to make it easier to work with.\n" |
55 | 55 | ] |
56 | 56 | }, |
57 | 57 | { |
|
64 | 64 | "tags": [] |
65 | 65 | }, |
66 | 66 | "source": [ |
67 | | - "**What's the URL of your dataset?**" |
| 67 | + "**What's the URL of your dataset?**\n" |
68 | 68 | ] |
69 | 69 | }, |
70 | 70 | { |
|
79 | 79 | ] |
80 | 80 | }, |
81 | 81 | "source": [ |
82 | | - "YOUR RESPONSE HERE" |
| 82 | + "YOUR RESPONSE HERE\n" |
83 | 83 | ] |
84 | 84 | }, |
85 | 85 | { |
|
94 | 94 | "source": [ |
95 | 95 | "### Step 1\n", |
96 | 96 | "\n", |
97 | | - "[Load it into Jupyter.](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments/open_ended.html#storing-data)" |
| 97 | + "[Load it into Jupyter.](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments/open_ended.html#storing-data)\n" |
98 | 98 | ] |
99 | 99 | }, |
100 | 100 | { |
|
122 | 122 | "source": [ |
123 | 123 | "### Step 2\n", |
124 | 124 | "\n", |
125 | | - "Open the [Population by Borough](https://data.cityofnewyork.us/City-Government/New-York-City-Population-by-Borough-1950-2040/xywu-7bv9) dataset and [load it into Jupyter](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments/open_ended.html#storing-data)." |
| 125 | + "Open the [Population by Borough](https://data.cityofnewyork.us/City-Government/New-York-City-Population-by-Borough-1950-2040/xywu-7bv9) dataset and [load it into Jupyter](https://python-public-policy.afeld.me/en/{{school_slug}}/assignments/open_ended.html#storing-data).\n" |
126 | 126 | ] |
127 | 127 | }, |
128 | 128 | { |
|
150 | 150 | "source": [ |
151 | 151 | "### Step 3\n", |
152 | 152 | "\n", |
153 | | - "Use [`merge()`](https://pandas.pydata.org/docs/user_guide/merging.html#merge) to combine the two, and output the resulting table." |
| 153 | + "Use [`merge()`](https://pandas.pydata.org/docs/user_guide/merging.html#merge) to combine the two, and output the resulting table.\n" |
154 | 154 | ] |
155 | 155 | }, |
156 | 156 | { |
|
173 | 173 | "<details>\n", |
174 | 174 | "<summary><strong>Hint</strong></summary>\n", |
175 | 175 | "Having trouble merging the datasets? Try looking at the unique values in the columns you're trying to merge on.\n", |
176 | | - "</details>" |
| 176 | + "</details>\n" |
177 | 177 | ] |
178 | 178 | }, |
179 | 179 | { |
|
199 | 199 | "1. Do a [`groupby()`](https://pandas.pydata.org/docs/user_guide/groupby.html) on the original dataset.\n", |
200 | 200 | "1. Join with the populations by borough.\n", |
201 | 201 | "1. Compute the per-capita values as a new column.\n", |
202 | | - "</details>" |
| 202 | + "</details>\n" |
203 | 203 | ] |
204 | 204 | }, |
205 | 205 | { |
|
225 | 225 | "\n", |
226 | 226 | "- [Pythonic Data Cleaning With Pandas and NumPy](https://realpython.com/python-data-cleaning-numpy-pandas/)\n", |
227 | 227 | "- [\"You’re Not Mapping Rats, You're Mapping Gentrification\"](https://deadspin.com/you-re-not-mapping-rats-you-re-mapping-gentrification-1835005060/) — article about bias in 311 data\n", |
228 | | - "- [The Spatial Data Equity Tool](https://medium.com/@urban_institute/introducing-a-spatial-equity-data-tool-b959c40298cf)\n", |
| 228 | + "- [The Spatial Data Equity Tool](https://urban-institute.medium.com/introducing-the-spatial-equity-data-tool-version-2-f2a8e900f84)\n", |
229 | 229 | "- [Intro to Plotly Express](https://plotly.com/python/plotly-express/). You don't have to work through every one of these examples; just review to get familiar with what types of charts are possible.\n", |
230 | 230 | "\n", |
231 | 231 | "### Optional\n", |
|
238 | 238 | "\n", |
239 | 239 | "## Participation\n", |
240 | 240 | "\n", |
241 | | - "Reminder about the [between-class participation requirement](https://python-public-policy.afeld.me/en/{{school_slug}}/syllabus.html#participation)." |
| 241 | + "Reminder about the [between-class participation requirement](https://python-public-policy.afeld.me/en/{{school_slug}}/syllabus.html#participation).\n" |
242 | 242 | ] |
243 | 243 | } |
244 | 244 | ], |
|
0 commit comments