Skip to content

Commit 0f96ef0

Browse files
committed
make a better dataframe name in lecture 1
1 parent 712e3a5 commit 0f96ef0

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

lecture_1.ipynb

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,8 @@
4040
}
4141
},
4242
"source": [
43-
"{% if id == \"nyu\" -%}\n",
44-
"- [Introductions thread](https://edstem.org/us/courses/68651/discussion/5579845)\n",
45-
"{% endif -%}\n",
46-
"- Questions?\n",
47-
"- How was the homework? 👍/👎"
48-
]
49-
},
50-
{
51-
"cell_type": "markdown",
52-
"metadata": {
53-
"editable": true,
54-
"slideshow": {
55-
"slide_type": "slide"
56-
},
57-
"tags": []
58-
},
59-
"source": [
60-
"## Generative AI\n",
61-
"\n",
62-
"We have [a policy](https://python-public-policy.afeld.me/en/{{school_slug}}/syllabus.html#academic-integrity)."
43+
"- How was the homework? 👍/👎\n",
44+
"- Questions?"
6345
]
6446
},
6547
{
@@ -331,7 +313,12 @@
331313
"cell_type": "code",
332314
"execution_count": 3,
333315
"metadata": {
334-
"id": "iQgE8qFAMbiF"
316+
"editable": true,
317+
"id": "iQgE8qFAMbiF",
318+
"slideshow": {
319+
"slide_type": ""
320+
},
321+
"tags": []
335322
},
336323
"outputs": [
337324
{
@@ -2455,25 +2442,32 @@
24552442
"cell_type": "code",
24562443
"execution_count": 13,
24572444
"metadata": {
2445+
"editable": true,
24582446
"id": "PII26jb0g8Eg",
2459-
"outputId": "8c839d5d-da47-4576-b1cb-86a147ec52e7"
2447+
"outputId": "8c839d5d-da47-4576-b1cb-86a147ec52e7",
2448+
"slideshow": {
2449+
"slide_type": ""
2450+
},
2451+
"tags": []
24602452
},
24612453
"outputs": [],
24622454
"source": [
24632455
"valid_complaint_types = valid_complaint_counts[\"Complaint Type\"]\n",
24642456
"is_valid_complaint = requests[\"Complaint Type\"].isin(valid_complaint_types)\n",
2465-
"df_cleaned = requests[is_valid_complaint]"
2457+
"requests_clean = requests[is_valid_complaint]"
24662458
]
24672459
},
24682460
{
24692461
"cell_type": "markdown",
24702462
"metadata": {
2463+
"editable": true,
24712464
"slideshow": {
24722465
"slide_type": "subslide"
2473-
}
2466+
},
2467+
"tags": []
24742468
},
24752469
"source": [
2476-
"How can we make sure this worked? Let's check how many records there were originally in `requests` vs how many are in `df_cleaned`.\n",
2470+
"How can we make sure this worked? Let's check how many records there were originally in `requests` vs how many are in `requests_clean`.\n",
24772471
"\n",
24782472
"Before:"
24792473
]
@@ -2534,7 +2528,7 @@
25342528
}
25352529
],
25362530
"source": [
2537-
"df_cleaned[\"Unique Key\"].size"
2531+
"requests_clean[\"Unique Key\"].size"
25382532
]
25392533
},
25402534
{
@@ -2715,7 +2709,7 @@
27152709
}
27162710
],
27172711
"source": [
2718-
"df_cleaned.groupby(\"Complaint Type\").size().reset_index(name=\"count\")"
2712+
"requests_clean.groupby(\"Complaint Type\").size().reset_index(name=\"count\")"
27192713
]
27202714
},
27212715
{
@@ -2940,7 +2934,7 @@
29402934
],
29412935
"source": [
29422936
"agency_counts = (\n",
2943-
" df_cleaned.groupby([\"Agency\", \"Complaint Type\"]).size().reset_index(name=\"count\")\n",
2937+
" requests_clean.groupby([\"Agency\", \"Complaint Type\"]).size().reset_index(name=\"count\")\n",
29442938
")\n",
29452939
"agency_counts.head(20)"
29462940
]

0 commit comments

Comments
 (0)