From 38f985905714da6514cde7eb9f99bf98eb7ca050 Mon Sep 17 00:00:00 2001 From: gsingh58 <gurmail-singh@wisc.edu> Date: Sat, 16 Sep 2023 16:43:39 -0500 Subject: [PATCH] Warning to not use the old projects --- lab-p1/main.ipynb | 12 +- lab-p10/practice.ipynb | 18 +- lab-p11/practice.ipynb | 18 +- lab-p12/practice.ipynb | 26 +- lab-p13/practice.ipynb | 18 +- lab-p2/bool.ipynb | 16 +- lab-p2/mod.ipynb | 16 +- lab-p2/ops.ipynb | 16 +- lab-p3/practice.ipynb | 18 +- lab-p4/practice.ipynb | 18 +- lab-p5/practice.ipynb | 18 +- lab-p6/practice.ipynb | 18 +- lab-p7/practice.ipynb | 18 +- lab-p8/practice.ipynb | 18 +- lab-p9/practice.ipynb | 18 +- p1/p1.ipynb | 18 +- p10/p10.ipynb | 18 +- p11/p11.ipynb | 18 +- p12/p12.ipynb | 18 +- p13/p13.ipynb | 18 +- p2/p2.ipynb | 18 +- p3/p3.ipynb | 21 +- p4/p4.ipynb | 18 +- p5/p5.ipynb | 18 +- p6/.ipynb_checkpoints/p6-checkpoint.ipynb | 1714 --------------------- p6/p6.ipynb | 18 +- p7/p7.ipynb | 18 +- p8/p8.ipynb | 18 +- p9/p9.ipynb | 18 +- 29 files changed, 471 insertions(+), 1746 deletions(-) delete mode 100644 p6/.ipynb_checkpoints/p6-checkpoint.ipynb diff --git a/lab-p1/main.ipynb b/lab-p1/main.ipynb index 1d2a27f..92bc11a 100644 --- a/lab-p1/main.ipynb +++ b/lab-p1/main.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "72e15fdf", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -13,7 +21,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -27,7 +35,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/lab-p10/practice.ipynb b/lab-p10/practice.ipynb index 606dac0..1281d75 100644 --- a/lab-p10/practice.ipynb +++ b/lab-p10/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "e2cad431", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -219,6 +227,14 @@ "Your output **must** be a **list** of **strings**. The order does **not** matter." ] }, + { + "cell_type": "markdown", + "id": "0be40c6b", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -2274,7 +2290,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/lab-p11/practice.ipynb b/lab-p11/practice.ipynb index 09cde55..0263f5d 100644 --- a/lab-p11/practice.ipynb +++ b/lab-p11/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "67267310", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -242,6 +250,14 @@ "You **must** first compute **two lists** which contain the *x*-coordinates and *y*-coordinates of the above points respectively. " ] }, + { + "cell_type": "markdown", + "id": "3ae2d40c", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -2036,7 +2052,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/lab-p12/practice.ipynb b/lab-p12/practice.ipynb index 2784027..f1ec806 100644 --- a/lab-p12/practice.ipynb +++ b/lab-p12/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "3667ded0", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "markdown", "id": "a1e8226b", @@ -261,6 +269,14 @@ "In lecture, you reviewed different ways to create pandas DataFrames. For this task, create a DataFrame `rankings` by reading the JSON data saved in `rankings.json`. " ] }, + { + "cell_type": "markdown", + "id": "f8a1afb8", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -346,6 +362,14 @@ "**Hint:** You can review the relevant lecture code [here](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-lecture-material/-/tree/main/s23/Michael_lecture_notes/27_Pandas-1) and [here](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-lecture-material/-/tree/main/s23/Gurmail_lecture_notes/27_Pandas-1)." ] }, + { + "cell_type": "markdown", + "id": "d185254f", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1053,7 +1077,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/lab-p13/practice.ipynb b/lab-p13/practice.ipynb index a39ac33..b84e96d 100644 --- a/lab-p13/practice.ipynb +++ b/lab-p13/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "d84aee96", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "markdown", "id": "115889c5", @@ -231,6 +239,14 @@ "# compute and store the answer in the variable 'good_us_institutions', but do NOT display it\n" ] }, + { + "cell_type": "markdown", + "id": "89b2fcdf", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -859,7 +875,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/lab-p2/bool.ipynb b/lab-p2/bool.ipynb index 15de074..8b1fcbb 100644 --- a/lab-p2/bool.ipynb +++ b/lab-p2/bool.ipynb @@ -1,5 +1,12 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -65,6 +72,13 @@ "passed" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -209,7 +223,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/lab-p2/mod.ipynb b/lab-p2/mod.ipynb index eeb9a17..3f6d742 100644 --- a/lab-p2/mod.ipynb +++ b/lab-p2/mod.ipynb @@ -1,5 +1,12 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -31,6 +38,13 @@ "0 % 12" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -394,7 +408,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/lab-p2/ops.ipynb b/lab-p2/ops.ipynb index 5651103..7b646b8 100644 --- a/lab-p2/ops.ipynb +++ b/lab-p2/ops.ipynb @@ -1,5 +1,12 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "attachments": { "precedence.png": { @@ -64,6 +71,13 @@ "3 ** 4 - 1" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": 2, @@ -310,7 +324,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/lab-p3/practice.ipynb b/lab-p3/practice.ipynb index 1347d12..d2d3967 100644 --- a/lab-p3/practice.ipynb +++ b/lab-p3/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "aed39b6f", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -291,6 +299,14 @@ "You **must not** hardcode the `id` of the car" ] }, + { + "cell_type": "markdown", + "id": "aae94290", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -999,7 +1015,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.0" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/lab-p4/practice.ipynb b/lab-p4/practice.ipynb index a899372..bf28655 100644 --- a/lab-p4/practice.ipynb +++ b/lab-p4/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "fffc0778", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -247,6 +255,14 @@ "**Question 2:** What is the first type (i.e., `type1`) of `Scorbunny`?" ] }, + { + "cell_type": "markdown", + "id": "e868d9fe", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -2056,7 +2072,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/lab-p5/practice.ipynb b/lab-p5/practice.ipynb index 9e2f601..d85f9fd 100644 --- a/lab-p5/practice.ipynb +++ b/lab-p5/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "193b246f", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -236,6 +244,14 @@ "**Question 1.2:** What is the `name` of the hurricane at **index** `1`? " ] }, + { + "cell_type": "markdown", + "id": "2807ec71", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -2205,7 +2221,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/lab-p6/practice.ipynb b/lab-p6/practice.ipynb index a28b70e..73e59b3 100644 --- a/lab-p6/practice.ipynb +++ b/lab-p6/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "605099bd", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -212,6 +220,14 @@ "It would be a good idea to use **slicing** to extract all the inner lists (except the header), and store them in a variable you can use later." ] }, + { + "cell_type": "markdown", + "id": "584d9445", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1712,7 +1728,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/lab-p7/practice.ipynb b/lab-p7/practice.ipynb index 488a2be..bb0ca70 100644 --- a/lab-p7/practice.ipynb +++ b/lab-p7/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "21313707", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -486,6 +494,14 @@ "**Important:** This dataset is different from the previous datasets you have worked with because every country in the dataset has **two** rows: one for the `year` *2015* and one for *2020*. This means that when working with data, you **need** to make sure to set your `for` loop in a way that will let you process two rows at once. Thankfully, the data is organized in such a way that for *each country*, the data from *2015* appears in the **even** indexed rows (0, 2, 4, ...), and the data from *2020* appears in the **odd** indexed rows (1, 3, , ...)." ] }, + { + "cell_type": "markdown", + "id": "0f67b985", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1728,7 +1744,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/lab-p8/practice.ipynb b/lab-p8/practice.ipynb index e028cd9..fc22ba2 100644 --- a/lab-p8/practice.ipynb +++ b/lab-p8/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "e3531578", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -341,6 +349,14 @@ "It is acceptable for you to *hardcode* **column indices** here. This is because this csv file does not have a header, and it is **implicit** that the first string is the ID and that the second string is the name associated with the ID. For csv files which have headers, you should **never** hardcode **column indices**." ] }, + { + "cell_type": "markdown", + "id": "f90895ec", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1471,7 +1487,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/lab-p9/practice.ipynb b/lab-p9/practice.ipynb index c136ef8..ad8ffd7 100644 --- a/lab-p9/practice.ipynb +++ b/lab-p9/practice.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "2c1f5e0a", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -220,6 +228,14 @@ " 'cast': ['Christian Bale', 'Steve Carell', 'Ryan Gosling', 'Brad Pitt']}]" ] }, + { + "cell_type": "markdown", + "id": "0e2da30a", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "markdown", "id": "e3c64dc0", @@ -1415,7 +1431,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p1/p1.ipynb b/p1/p1.ipynb index 5a5549c..53af7b5 100644 --- a/p1/p1.ipynb +++ b/p1/p1.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "2c83240f", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -84,6 +92,14 @@ "**Question 2:** Compute current year." ] }, + { + "cell_type": "markdown", + "id": "d28cd3cc", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -186,7 +202,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p10/p10.ipynb b/p10/p10.ipynb index 00e9b79..0faf9de 100644 --- a/p10/p10.ipynb +++ b/p10/p10.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "1f0b67d8", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -352,6 +360,14 @@ "**Warning:** Please **do not hardcode** `\"/\"` or `\"\\\"` in your path because doing so will cause your function to **fail** on a computer that's not using the same operating system as yours. This may result in your code failing on Gradescope." ] }, + { + "cell_type": "markdown", + "id": "a8049e82", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1921,7 +1937,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p11/p11.ipynb b/p11/p11.ipynb index 8d7c031..7c6d451 100644 --- a/p11/p11.ipynb +++ b/p11/p11.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "8f7991eb", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -275,6 +283,14 @@ "# copy/paste the definition of the namedtuple 'Star' here\n" ] }, + { + "cell_type": "markdown", + "id": "2d4e4eac", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -2237,7 +2253,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p12/p12.ipynb b/p12/p12.ipynb index 9ac3a90..3f29810 100644 --- a/p12/p12.ipynb +++ b/p12/p12.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "bccb2cd3", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -305,6 +313,14 @@ "# compute and store the answer in the variable 'num_countries', then display it\n" ] }, + { + "cell_type": "markdown", + "id": "808a592c", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1474,7 +1490,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p13/p13.ipynb b/p13/p13.ipynb index ab52638..11d42a9 100644 --- a/p13/p13.ipynb +++ b/p13/p13.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "ac0b4292", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -230,6 +238,14 @@ "# copy/paste the definition of the function 'bar_plot' from lab-p13 here\n" ] }, + { + "cell_type": "markdown", + "id": "9c97a9a9", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1938,7 +1954,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p2/p2.ipynb b/p2/p2.ipynb index 132261d..2af1da8 100644 --- a/p2/p2.ipynb +++ b/p2/p2.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "82899288", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -233,6 +241,14 @@ "**Question 2:** What does the expression `350 - 31` evaluate to?" ] }, + { + "cell_type": "markdown", + "id": "ff8b8464", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1124,7 +1140,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p3/p3.ipynb b/p3/p3.ipynb index 85f6606..d1fef30 100644 --- a/p3/p3.ipynb +++ b/p3/p3.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "8e077b5d", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -76,7 +84,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "ed6d6e6a", "metadata": {}, @@ -165,7 +172,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "04d5883c", "metadata": {}, @@ -267,6 +273,14 @@ "Instead of repeatedly calling `project.get_id` function for each question, make these calls once at the beginning of your notebook and save the results in variables. Recall that calling the same function multiple times with the same argument(s) is a waste of computation. Complete the code in the below cell and make sure to use the relevant ID variables for the rest of the project questions." ] }, + { + "cell_type": "markdown", + "id": "9981d7d5", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -450,7 +464,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "id": "3f2ace5a", "metadata": {}, @@ -1369,7 +1382,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p4/p4.ipynb b/p4/p4.ipynb index 0d3efee..003a2a5 100644 --- a/p4/p4.ipynb +++ b/p4/p4.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "2d57e1cc", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -321,6 +329,14 @@ "**Question 2:** How much damage does `Lucario` do to `Klawf`?" ] }, + { + "cell_type": "markdown", + "id": "59c43dd0", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1553,7 +1569,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p5/p5.ipynb b/p5/p5.ipynb index e91a603..8641f92 100644 --- a/p5/p5.ipynb +++ b/p5/p5.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "85ad6b8e", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -277,6 +285,14 @@ "**Question 2:** How many `deaths` were caused by the hurricane at index `315`?" ] }, + { + "cell_type": "markdown", + "id": "d58db237", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1250,7 +1266,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p6/.ipynb_checkpoints/p6-checkpoint.ipynb b/p6/.ipynb_checkpoints/p6-checkpoint.ipynb deleted file mode 100644 index 672d7c3..0000000 --- a/p6/.ipynb_checkpoints/p6-checkpoint.ipynb +++ /dev/null @@ -1,1714 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "cec7bf82", - "metadata": { - "cell_type": "code", - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "# import and initialize otter\n", - "import otter\n", - "grader = otter.Notebook(\"p6.ipynb\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "66c622bb", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "import p6_test" - ] - }, - { - "cell_type": "markdown", - "id": "c3ab6456", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "# Project 6: Airbnb" - ] - }, - { - "cell_type": "markdown", - "id": "350b4db3", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "## Learning Objectives:\n", - "\n", - "In this project, you will demonstrate how to:\n", - "\n", - "* access and utilize data in CSV files,\n", - "* process real world datasets,\n", - "* use string methods and sorting function / method to order data.\n", - "\n", - "Please go through [Lab-P6](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-s23-projects/-/tree/main/lab-p6) before working on this project. The lab introduces some useful techniques related to this project." - ] - }, - { - "cell_type": "markdown", - "id": "8480d85c", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "## Testing your code:\n", - "\n", - "Along with this notebook, you must have downloaded the file `p6_test.py`. If you are curious about how we test your code, you can explore this file, and specifically the value of the variable `expected_json`, to understand the expected answers to the questions." - ] - }, - { - "cell_type": "markdown", - "id": "3e3a06d9", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "## Project Description:\n", - "\n", - "Data Science can help us understand user behavior on online platform services. This project is about the rooms listed on Airbnb. Since 2008, guests and hosts have used Airbnb to expand on traveling possibilities and present a more unique, personalized way of experiencing the world. `airbnb.csv` has data of nearly 50,000 listings on Airbnb from New York City, NY from the year 2019. This file includes a lot of information about the hosts, geographical availability of the listings, and other necessary metrics to make predictions and draw conclusions. You will be using various string manipulation methods that come with Python as well as creating some of your own functions to solve the problems posed. Happy coding!" - ] - }, - { - "cell_type": "markdown", - "id": "232e134c", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "## Dataset:\n", - "\n", - "A small portion of the dataset `airbnb.csv` you will be working with for this project is reproduced here:" - ] - }, - { - "cell_type": "markdown", - "id": "36b9b9a2", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "room_id|name|host_id|host_name|neighborhood_group|neighborhood|latitude|longitude|room_type|price|minimum_nights|number_of_reviews|last_review|reviews_per_month|calculated_host_listings_count|availability_365\n", - "------|------|------|------|------|------|------|------|------|------|------|------|------|------|------|------|\n", - "2539|Clean & quiet apt home by the park|2787|John|Brooklyn|Kensington|40.64749000000001|-73.97237|Private room|149|1|9|2018-10-19|0.21|6|365\n", - "2595|Skylit Midtown Castle|2845|Jennifer|Manhattan|Midtown|40.75362|-73.98376999999998|Entire home/apt|225|1|45|2019-05-21|0.38|2|355\n", - "3647|THE VILLAGE OF HARLEM....NEW YORK !|4632|Elisabeth|Manhattan|Harlem|40.80902|-73.9419|Private room|150|3|0|||1|365\n", - "3831|Cozy Entire Floor of Brownstone|4869|LisaRoxanne|Brooklyn|Clinton Hill|40.68514|-73.95976|Entire home/apt|89|1|270|2019-07-05|4.64|1|194\n", - "5022|Entire Apt: Spacious Studio/Loft by central park|7192|Laura|Manhattan|East Harlem|40.79851|-73.94399|Entire home/apt|80|10|9|2018-11-19|0.1|1|0\n", - "5099|Large Cozy 1 BR Apartment In Midtown East|7322|Chris|Manhattan|Murray Hill|40.74767|-73.975|Entire home/apt|200|3|74|2019-06-22|0.59|1|129" - ] - }, - { - "cell_type": "markdown", - "id": "09a9e49a", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "You can find more details on the dataset in [Lab-P6](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-s23-projects/-/tree/main/lab-p6)." - ] - }, - { - "cell_type": "markdown", - "id": "94a8f0e3", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "## Questions and Functions:\n", - "\n", - "Let us start by importing all the modules we will need for this project." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "96a3f4b1", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# it is considered a good coding practice to place all import statements at the top of the notebook\n", - "# please place all your import statements in this cell if you need to import any more modules for this project\n" - ] - }, - { - "cell_type": "markdown", - "id": "85ada17e", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "#### Now, copy and paste the `process_csv` and `cell` functions from your Lab-P6 notebook to the cell below.\n", - "\n", - "You are expected to call the `process_csv` function correctly, and read the data on `airbnb.csv`. After reading the file, define the `csv_header`, and `csv_rows` variables as in Lab-P6, and define the `cell` function.\n", - "\n", - "**Important:** You **must** only use the `cell` function to extract data from the dataset. If you extract any data without explicitly using this function, you will **lose points** during manual review. It is recommended but **optional** that you use the `cell_v2` function defined in Lab-P6. However, you **must** rename the function to `cell` in this notebook. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3d5e2ddf", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "id": "c7d05d92", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 1:** What **unique** neighborhood groups (`neighborhood_group`) are included in the dataset?\n", - "\n", - "Your output **must** be a *list* which stores all the **unique** neighborhood groups (i.e., without any duplicates). The order **does not** matter." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1c13a292", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'neighborhood_groups', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6caaea45", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q1\")" - ] - }, - { - "cell_type": "markdown", - "id": "7a12711e", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 2:** What is the **average** `price` of all rooms in the dataset?" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "583a7631", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'avg_price', then display it" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2e2a9f90", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q2\")" - ] - }, - { - "cell_type": "markdown", - "id": "a9e14251", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 3:** How many rooms are in the `neighborhood` of *SoHo*?" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4ac30f8f", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'count_soho', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a2980991", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q3\")" - ] - }, - { - "cell_type": "markdown", - "id": "937e80b5", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "### Function 1: `find_room_names(phrase)`\n", - "\n", - "We require you to complete the below function and use it to answer question 4 to 6 \n", - "(this is a **requirement**, and you will **lose points** if you do not implement this function). You can review string methods from the [lecture on Feb 24](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-lecture-material/-/blob/main/s23/Common_to_all_lectures/13_Strings/13_Strings.pdf)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "722a84ab", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "def find_room_names(phrase):\n", - " \"\"\"\n", - " find_room_names(phrase) returns a list of all the room names that CONTAINS the \n", - " substring (case insensitive match) `phrase`.\n", - " \"\"\"\n", - " pass # replace with your code \n", - " # TODO: create an empty list\n", - " # TODO: ignore rooms that do not have data entry for name, as indicated by a value of None\n", - " # TODO: check if the room name string contains phrase (case insensitive match)\n", - " # TODO: if so, add these room names to the list (the room names should be as in the dataset)\n", - " # TODO: return your list of room names\n", - " ..." - ] - }, - { - "cell_type": "markdown", - "id": "6d12cb62", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 4:** Find all room names that contain the string `\"free wifi\"`.\n", - " \n", - "Your output **must** be a *list*. The order **does not** matter. You **must** call the `find_room_names` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8ade7385", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'rooms_free_wifi', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "91fea5bb", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q4\")" - ] - }, - { - "cell_type": "markdown", - "id": "8b015854", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 5:** Find all room names that contain **either** `\"cinema\"` **or** `\"film\"`.\n", - "\n", - "Your output **must** be a *list*. The order **does not** matter, but if a room's `name` contains **both** `\"cinema\"` and `\"film\"`, then the room must be included **only once** in your list. You **must** call the `find_room_names` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "bb37417f", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'rooms_contain_cinema_film', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "00f66b87", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q5\")" - ] - }, - { - "cell_type": "markdown", - "id": "3e334c28", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 6:** Find the **longest** room `name` that contains the word `\"fun\"`.\n", - "\n", - "There is a **unique** such room with the longest `name`, so you **do not** have to worry about breaking ties. You **must** call the `find_room_names` function to answer this question. You **must** initialize the variable `funnest_room` to be `None`." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "98bb93e2", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'funnest_room', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e3137e78", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q6\")" - ] - }, - { - "cell_type": "markdown", - "id": "98819e95", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 7:** Find the names (`name`) of all the rooms which have `price` *0* and have **more than** *90* reviews (`number_of_reviews`).\n", - "\n", - "Your output **must** be a *list*. The names **must** be sorted in **ascending (alphabetical) order**." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5f452682", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'no_cost_rooms', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2946c170", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q7\")" - ] - }, - { - "cell_type": "markdown", - "id": "d510f8a1", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 8:** What neighborhoods (`neighborhood`) are the rooms that have `price` greater than *9999* located in?\n", - "\n", - "Your output **must** be a *list* of **unique** neighborhoods (i.e., without any duplicates). The names **must** be sorted in **descending (reverse-alphabetical) order**." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8b518213", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'pricey_neighborhoods', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "bdba4596", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q8\")" - ] - }, - { - "cell_type": "markdown", - "id": "2fa18d66", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 9:** How many rooms received their `last_review` **in or before** *2015*?\n", - "\n", - "You should **ignore** rooms for which the `last_review` data is missing.\n", - "\n", - "**Hint:** You can find the date of the last review in the `last_review` column. \n", - "You can review the get_year function from [lab-p5](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-s23-projects/-/tree/main/lab-p5)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fe337eab", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'last_review_before_2015', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e4692707", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q9\")" - ] - }, - { - "cell_type": "markdown", - "id": "6dbff213", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "### Function 2: `avg_price_per_room_type(room_type, neighborhood)`\n", - "\n", - "We require you to complete the below function to answer the next several questions (this is a **requirement**, and you will **lose points** if you do not implement this function)." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "243e812a", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "def avg_price_per_room_type(room_type, neighborhood):\n", - " '''\n", - " avg_price_per_room_type(room_type, neighborhood) returns the average price of \n", - " rooms of the type `room_type` in the given `neighborhood`; if there are no\n", - " rooms of the type `room_type` in the given `neighborhood`, it returns `None`\n", - " '''\n", - " pass # replace with your code " - ] - }, - { - "cell_type": "markdown", - "id": "34620d59", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 10:** What is the **average** `price` of a *Private room* (`room_type`) in the`neighborhood` *Little Neck*?\n", - "\n", - "You **must** call the `avg_price_per_room_type` function to answer this question.\n", - "\n", - "**Hint:** To help you debug your code in case you run into any bugs, we have reproduced in the cell below, **all** the rows in the dataset from the `neighborhood` *Little Neck*. If you run into bugs with `avg_price_per_room_type`, it is recommended that you go through your code and verify that it does what it is supposed to, for this tiny dataset." - ] - }, - { - "cell_type": "markdown", - "id": "b4248fc0", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "room_id|name|host_id|host_name|neighborhood_group|neighborhood|latitude|longitude|room_type|price|minimum_nights|number_of_reviews|last_review|reviews_per_month|calculated_host_listings_count|availability_365\n", - "------|------|------|------|------|------|------|------|------|------|------|------|------|------|------|------|\n", - "20227428|Douglaston Apartment Room A|18996093|Leonard|Queens|Little Neck|40.75794000000001|-73.72955999999998|Private room|45|1|12|2019-06-22|0.55|5|133\n", - "21025083|Douglaston (apt 2) Room one\\n(Largest room)|18996093|Leonard|Queens|Little Neck|40.75777|-73.72949|Private room|50|1|6|2018-12-16|0.31|5|94\n", - "30325639|Cozy shared studio in a safe neighborhood|21495656|Ramy|Queens|Little Neck|40.76212|-73.71928|Shared room|32|3|1|2018-12-04|0.14|1|88\n", - "31553066|Near major transportation|41090359|Abi|Queens|Little Neck|40.77122|-73.738|Private room|100|1|0|||1|88\n", - "35515780|30-min to Manhattan Quiet Big House in Great Neck|31859704|Vincent|Queens|Little Neck|40.77444000000001|-73.73373000000002|Entire home/apt|149|3|0|||1|3" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b441c819", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'pvt_room_little_neck', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "98922e5e", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q10\")" - ] - }, - { - "cell_type": "markdown", - "id": "2766870f", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 11:** On average, how much **more** expensive (`price`) is a *Entire home/apt* (`room_type`) than a *Private room* (`room_type`) in the `neighborhood` *Astoria*?\n", - "\n", - "You **must** call the `avg_price_per_room_type` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "588ee84b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'home_pvt_room_astoria_diff', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "82cabe88", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q11\")" - ] - }, - { - "cell_type": "markdown", - "id": "e3836b5a", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "### Function 3: `find_prices_within(lat_min, lat_max, long_min, long_max)` \n", - "\n", - "We require you to complete the below function to answer the next several questions (this is a **requirement**, and you will **lose points** if you do not implement this function)." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ca1be9c1", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "def find_prices_within(lat_min, lat_max, long_min, long_max):\n", - " \"\"\"\n", - " find_prices_within(lat_min, lat_max, long_min, long_max) returns an unordered \n", - " list of prices of all the rooms within the geographical location between and including\n", - " the latitudes lat_min and lat_max and longitudes long_min and long_max.\n", - " \"\"\"\n", - " pass # replace with your code" - ] - }, - { - "cell_type": "markdown", - "id": "7cb93af3", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 12:** What is the **lowest** `price` room near *NYU* (`40.729 <= latitude <= 40.73, -74.01 <= longitude <= -74.00`)?\n", - "\n", - "You **must** call the `find_prices_within` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "89e9a9f8", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'min_price_nyu', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c7bc48e6", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q12\")" - ] - }, - { - "cell_type": "markdown", - "id": "35092860", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "### Function 4: `median(items)` \n", - "\n", - "We require you to complete the below function to answer the next several questions (this is a **requirement**, and you will **lose points** if you do not implement this function).\n", - "You may copy/paste this function from your Lab-P6 notebook." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "41a321b1", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "def median(items):\n", - " \"\"\"\n", - " median(items) returns the median of the list `items`\n", - " \"\"\"\n", - " pass # replace with your code\n", - " # you may copy/paste this function from your Lab-P6 notebook" - ] - }, - { - "cell_type": "markdown", - "id": "aecac920", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 13:** What is the **median** `price` of the rooms near *Columbia University* (`40.79 <= latitude <= 40.80, -73.96 <= longitude <= -73.95`)?\n", - "\n", - "You **must** call the `find_prices_within` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1167d39b", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'median_price_columbia', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4b0108fa", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q13\")" - ] - }, - { - "cell_type": "markdown", - "id": "e0f6fdc4", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 14:** What **percentage** of rooms near *Rockefeller Center* (`40.749 <= latitude <= 40.75, -73.98 <= longitude <= -73.97`) have a `price` **more than** *100*?\n", - "\n", - "Your answer **must** be a *float* value between *0* and *100*. You **must** call the `find_prices_within` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4ff94931", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'pct_price_over_hundred', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "54ed36d0", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q14\")" - ] - }, - { - "cell_type": "markdown", - "id": "fd02b61a", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "### Function 5: `avg_review_avail_ratio(neighborhood)` \n", - "\n", - "We require you to complete the below function to answer the next several questions (this is a **requirement**, and you will **lose points** if you do not implement this function). \n", - "\n", - "$$\\text{Ratio of number of reviews and availability =} \\frac{\\texttt{number_of_reviews}}{\\texttt{availability_365}}$$\n", - " \n", - "In this function, we want to compute the **average ratio** of `number_of_reviews` and `availability_365` in a `neighborhood`.\n", - "\n", - "You **must** **ignore** rooms that have `availability_365` data of 0. \n", - "You **must** also **ignore** rooms for which the ratio cannot be computed due to **missing data** (i.e., either the numerator or denominator is **missing**).\n", - "\n", - "**For example**, Let's consider a sample dataset which only has two rooms, and we want to compute the average ratio of `number_of_reviews` and `availability_365` in *Jamaica*\n", - "\n", - "`name`|`number_of_reviews`| `availability_365`|`neighborhood`\n", - "------|------|------|------|\n", - "room_one| 4 | 200| Jamaica\n", - "room_two| 200| 20 |Jamaica\n", - "\n", - "\n", - "1. Compute the ratio for each of the room in the `neighborhood` *Jamaica*: \n", - "\n", - " review-availability ratio for room_one = 4 / 200 = 0.02.\n", - " \n", - " review-availability ratio for room_two = 200 / 20 = 10. \n", - " \n", - "2. Calculate the average between the two ratios:\n", - " $$\\texttt{average_review_availability} \\text{ in Jamaica} = \\frac{0.02 + 10}{2} = 5.01.$$\n", - " \n", - "**Hints:**\n", - "1. The denominator is the availability of a room (`availability_365`). The numerator is the number of reviews of a room (`number_of_reviews column`). \n", - "2. Be careful! You need to compute the ratio for each room in the given neighborhood, then take the average of those ratios. Simply dividing the sum of reviews by the sum of availability will calculate the wrong answer." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7c6c9749", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "def avg_review_avail_ratio(neighborhood):\n", - " \"\"\"\n", - " avg_review_avail_ratio(neighborhood) returns the average of the ratios of \n", - " number of reviews to availability of all rooms in the `neighborhood`;\n", - " If there are no rooms in the `neighborhood` for which the ratio can\n", - " be computed, then the function returns `None`\n", - " \"\"\"\n", - " pass # replace with your code\n", - " # TODO: you should **ignore** rooms that have `availability_365` data of 0\n", - " # TODO: you should **ignore** rooms for which the ratio cannot be computed due to missing data\n", - " # Hint: the numerator is the number of reviews of a room (`number_of_reviews column`)\n", - " # Hint: the denominator is the availability of a room (`availability_365` column)\n", - " # Hint: note that you need to compute the average of the ratios, **not** the ratio of the averages.\n", - " # you must compute the ratio for each room in the `neighborhood`, then take the average of those ratios.\n", - " # simply dividing the sum of reviews by the sum of availability will calculate the wrong answer." - ] - }, - { - "cell_type": "markdown", - "id": "0ceca136", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 15:** What is the **average of the ratios** of the `number_of_reviews` to `availability_365` in the `neighborhood` *Bushwick*?\n", - "\n", - "You **must** call the `avg_review_avail_ratio` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a8cf34c9", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'bushwick_avg_ratio', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "bc43cf68", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q15\")" - ] - }, - { - "cell_type": "markdown", - "id": "defaf37e", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 16:** What is the **average of the ratios** of the `number_of_reviews` to `availability_365` in the `neighborhood` *Manhattan Beach*?\n", - "\n", - "You **must** call the `avg_review_avail_ratio` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8d8ddc0e", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'manhattan_beach_avg_ratio', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "13ba034f", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q16\")" - ] - }, - { - "cell_type": "markdown", - "id": "744122c7", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 17:** Which `neighborhood` in the `neighborhood_group` *Staten Island* has the **highest average of ratios** of the `number_of_reviews` to `availability_365`?\n", - "\n", - "You **must** **ignore** any `neighborhood` for which the average ratio **cannot be computed**.\n", - "\n", - "**Clarification:** Don't worry about it if this cell takes around 10 seconds to run, that is expected. If it takes much longer (i.e., more than 30 seconds), you **must** optimize your code. Attend office hours if you are unable to get your code to run faster.\n", - "\n", - "**Hint:** You do not need to compute the average of ratios for the **same** `neighborhood` more than once. Make a list of the **unique** neighborhoods in *Staten Island* first, and then find the **highest average of ratios** among those `neighborhoods`." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "624f1d31", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'max_nbhd_staten_island', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ef9fb72d", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q17\")" - ] - }, - { - "cell_type": "markdown", - "id": "d38c664b", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "### Function 6: `find_good_rooms(room_type, neighborhood, number_of_reviews_threshold)`\n", - "\n", - "We require you to complete the below function to answer the next several questions (this is a **requirement**, and you will **lose points** if you do not implement this function). \n", - "\n", - "Price, location, room type and number of reviews are metrics that people look into when they book a room in Airbnb. \n", - "In this function, we want to return a **list** of all the room names (`name`) of the given `room_type` from the given `neighborhood` who have received **at least** `number_of_reviews_threshold` many reviews (`number_of_reviews`), and are **cheaper** than the **average** priced (`price`) room of the given `room_type` from that `neighborhood`.\n", - "\n", - "The order of the **list** does **not** matter. You **must** **ignore** any rooms for which the `price`, `room_type`, `neighborhood`, or `number_of_reviews` data is **missing**. If the average `price` of rooms of the given `room_type` from the given `neighborhood` **cannot be computed** due to missing data, then the function **must** return `None`.\n", - "\n", - "**For example**, let's consider the following small dataset: \n", - "\n", - "`name`| `price` |`number_of_reviews`|`room_type`|`neighborhood`\n", - "------|------|------|------|------|\n", - "room_one| 65 | 165| Private room |Jamaica\n", - "room_two| 50 |200| Private room |Jamaica\n", - "room_three| 80| 120| Private room |Jamaica\n", - "room_four| 300| 300| Private room |Jamaica\n", - "room_five| 450| 240| Private room |Jamaica\n", - "room_six| 180| 150| Private room |Jamaica\n", - "\n", - "In this small dataset, we want to find the list of all room names in *Jamaica* of `room_type` *Private room* with **at least** *150* reviews that have a price **lower** than the **average** price of `room_type` *Private room* in *Jamaica*. \n", - " \n", - "1. The **average** `price` of a *Private room* in the `neighborhood` *Jamaica* is:\n", - "$$\\frac{65 + 50 + 80 + 300 + 450 + 180}{6} = 187.5.$$ \n", - "\n", - "2. We can see that there are *4* rooms (`room_one`, `room_two`, `room_three`, and `room_six`) with a `price` **lower** than the **average**, *187.5*. Of these rooms, *3* of them (`room_one`, `room_two`, and `room_six`) also have `number_of_reviews` **at least** *150*.\n", - "\n", - "3. So, the output should be the **list** `[\"room_one\", \"room_two\", \"room_six\"]`.\n", - "\n", - "The `find_good_rooms` function definition **must** invoke the function `avg_price_per_room_type`. **We'll manually deduct points** if you don't use `avg_price_per_room_type`. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "99284b30", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "def find_good_rooms(room_type, neighborhood, number_of_reviews_threshold=150):\n", - " \"\"\"\n", - " find_good_rooms(room_type, neighborhood, number_of_reviews_threshold)\n", - " returns a list of room `names` having at least the given `number_of_reviews` \n", - " that also have a price that is lower than the average price of rooms\n", - " of the same `room_type` from the same `neighborhood`\n", - " \"\"\" \n", - " pass # replace with your code\n", - " # TODO: use 'avg_price_per_room_type' to find the average `price` of rooms\n", - " # of the given `room_type` from the given `neighborhood`\n", - " # TODO: create an empty list\n", - " # TODO: add the names of all the rooms of the given `room_type` from the\n", - " # the given `neighborhood` with `price` lower than the average\n", - " # and `number_of_reviews` at least the threshold\n", - " # TODO: return the list" - ] - }, - { - "cell_type": "markdown", - "id": "1264dc54", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 18:** Find a **list** of all the *Entire home/apt* type rooms (`room_type`) in the *Chinatown* `neighborhood` with at least *100* reviews (`number_of_reviews`) that are cheaper than average.\n", - "\n", - "Your answer **must** be a **list**. The order does **not** matter. You **must** call the `find_good_rooms` function to answer this question." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f1ca2816", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'good_chinatown_rooms', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7433079b", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q18\")" - ] - }, - { - "cell_type": "markdown", - "id": "a8f6d90f", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 19:** Find a **list** of all the *Private room* type rooms (`room_type`) in the *Harlem* `neighborhood` with $\\geq 300$ and $< 500$ reviews (`number_of_reviews`) that are cheaper than average.\n", - "\n", - "Your answer **must** be a **list**. The order does **not** matter. You **must** call the `find_good_rooms` function to answer this question.\n", - "\n", - "**Hint**: Call the `find_good_rooms` function twice with the two different `number_of_reviews_threshold` values, and use these two lists to compute the answer." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0f8d1637", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'decent_harlem_rooms', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4473e299", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q19\")" - ] - }, - { - "cell_type": "markdown", - "id": "73681939", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "**Question 20:** On a trip to NYC, you need to stay for *3* days in *Queens*, and then *4* days in *Brooklyn*. What is the **minimum** amount of money you need to spend on this trip?\n", - "\n", - "Note that:\n", - "1. The `price` of each room is for one day, and you'll only stay in one room at each location.\n", - "2. The total cost = (lowest price in *Queens*) * 3 + (lowest price in *Brooklyn*) * 4.\n", - "3. You'll need to **skip** those rooms that don't have enough availability, for example, you **must** ignore rooms in *Queens* whose availability is **less than** *3*.\n", - "4. You'll need to **skip** those rooms for which you don't meet the required number of `minimum_nights`, for example, you **must** ignore rooms in *Brooklyn* whose `minimum_nights` is **greater than** *4*.\n", - "5. You **must** skip all rooms with any of the relevant data missing.\n", - "\n", - "\n", - "**Hint:** You might want to define a helper function to compute the **minimum** daily `price` of a room in a given `neighborhood_group` among rooms whose `availability_365` is at least the number of days one will be staying in that neighborhood group, and the `minimum_nights` is at most the number of the number of days one will be staying in that neighborhood group." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f99d0a08", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# compute and store the answer in the variable 'min_cost_trip', then display it\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d80ed37a", - "metadata": { - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "grader.check(\"q20\")" - ] - }, - { - "cell_type": "markdown", - "id": "91e0ce42", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - "## Submission\n", - "It is recommended that at this stage, you Restart and Run all Cells in your notebook.\n", - "That will automatically save your work and generate a zip file for you to submit.\n", - "\n", - "**SUBMISSION INSTRUCTIONS**:\n", - "1. **Upload** the zipfile to Gradescope.\n", - "2. Check **Gradescope otter** results as soon as the auto-grader execution gets completed. Don't worry about the score showing up as -/100.0. You only need to check that the test cases passed." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7d571556", - "metadata": { - "cell_type": "code" - }, - "outputs": [], - "source": [ - "# running this cell will create a new save checkpoint for your notebook\n", - "from IPython.display import display, Javascript\n", - "display(Javascript('IPython.notebook.save_checkpoint();'))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "023947a7", - "metadata": { - "cell_type": "code", - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "!jupytext --to py p6.ipynb" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6cc6260d", - "metadata": { - "cell_type": "code", - "deletable": false, - "editable": false - }, - "outputs": [], - "source": [ - "p6_test.check_file_size(\"p6.ipynb\")\n", - "grader.export(pdf=False, run_tests=True, files=[\"p6.py\"])" - ] - }, - { - "cell_type": "markdown", - "id": "1d42dabf", - "metadata": { - "deletable": false, - "editable": false - }, - "source": [ - " " - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.13" - }, - "otter": { - "OK_FORMAT": true, - "tests": { - "q1": { - "name": "q1", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q1\", neighborhood_groups)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q10": { - "name": "q10", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q10\", pvt_room_little_neck)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q11": { - "name": "q11", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q11\", home_pvt_room_astoria_diff)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q12": { - "name": "q12", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q12\", min_price_nyu)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q13": { - "name": "q13", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q13\", median_price_columbia)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q14": { - "name": "q14", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q14\", pct_price_over_hundred)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q15": { - "name": "q15", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q15\", bushwick_avg_ratio)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q16": { - "name": "q16", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q16\", manhattan_beach_avg_ratio)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q17": { - "name": "q17", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q17\", max_nbhd_staten_island)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q18": { - "name": "q18", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q18\", good_chinatown_rooms)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q19": { - "name": "q19", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q19\", decent_harlem_rooms)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q2": { - "name": "q2", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q2\", avg_price)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q20": { - "name": "q20", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q20\", min_cost_trip)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q3": { - "name": "q3", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q3\", count_soho)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q4": { - "name": "q4", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q4\", rooms_free_wifi)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q5": { - "name": "q5", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q5\", rooms_contain_cinema_film)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q6": { - "name": "q6", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q6\", funnest_room)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q7": { - "name": "q7", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q7\", no_cost_rooms)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q8": { - "name": "q8", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q8\", pricey_neighborhoods)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - }, - "q9": { - "name": "q9", - "points": 5, - "suites": [ - { - "cases": [ - { - "code": ">>> p6_test.check(\"q9\", last_review_before_2015)\nTrue", - "hidden": false, - "locked": false - } - ], - "scored": true, - "setup": "", - "teardown": "", - "type": "doctest" - } - ] - } - } - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/p6/p6.ipynb b/p6/p6.ipynb index 672d7c3..7e859d7 100644 --- a/p6/p6.ipynb +++ b/p6/p6.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "35af973b", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -227,6 +235,14 @@ "**Question 2:** What is the **average** `price` of all rooms in the dataset?" ] }, + { + "cell_type": "markdown", + "id": "3dd42dbe", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1321,7 +1337,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p7/p7.ipynb b/p7/p7.ipynb index a692a0c..ef7e0c2 100644 --- a/p7/p7.ipynb +++ b/p7/p7.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "d1aecdd1", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -237,6 +245,14 @@ "First, read the data stored in `water_accessibility.csv`. You **must** read the csv file and then get the header and rows (and store them into `csv_header` and `csv_rows` variables). You will **lose points** if you use any other names to store these variables." ] }, + { + "cell_type": "markdown", + "id": "5270d355", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1633,7 +1649,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p8/p8.ipynb b/p8/p8.ipynb index bb4320f..64df7f5 100644 --- a/p8/p8.ipynb +++ b/p8/p8.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "99b48408", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -197,6 +205,14 @@ "\n" ] }, + { + "cell_type": "markdown", + "id": "51b205a3", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1446,7 +1462,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, diff --git a/p9/p9.ipynb b/p9/p9.ipynb index 590e95e..1f28054 100644 --- a/p9/p9.ipynb +++ b/p9/p9.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "35424a18", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -214,6 +222,14 @@ "Copy the functions you wrote in `p8.ipynb` to `p9.ipynb` to read the movies data. The functions you should include are `process_csv`, `get_mapping`, `get_raw_movies`, and `get_movies` along with any helper functions you used to write these. Do **not** copy/paste `find_specific_movies` here. Later in P9, we will provide you with a simpler version of that function, which does not require the use of the `copy` module." ] }, + { + "cell_type": "markdown", + "id": "f934f2a6", + "metadata": {}, + "source": [ + "<h1><font color = \"red\">\"This is an out of date page, don't use it for the current semester\" </font></h1>" + ] + }, { "cell_type": "code", "execution_count": null, @@ -1342,7 +1358,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.11.4" }, "otter": { "OK_FORMAT": true, -- GitLab