diff --git a/lab-p7/practice.ipynb b/lab-p7/practice.ipynb index efa2ab5c4e758a2a5baec1515a64ac63491c0220..488a2be13f979431d450bd490e6c7d00db5e6d2f 100644 --- a/lab-p7/practice.ipynb +++ b/lab-p7/practice.ipynb @@ -3,7 +3,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abc3b06b", + "id": "b7aabc90", "metadata": { "deletable": false, "editable": false @@ -18,7 +18,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c18a96f5", + "id": "f9ab57c5", "metadata": {}, "outputs": [], "source": [ @@ -27,7 +27,7 @@ }, { "cell_type": "markdown", - "id": "c94d1b64", + "id": "f6ea67d3", "metadata": {}, "source": [ "# Lab-P7: Dictionaries (Drinking Water Accessibility)" @@ -35,7 +35,22 @@ }, { "cell_type": "markdown", - "id": "b20b5975", + "id": "504cefc2", + "metadata": {}, + "source": [ + "<h2 style=\"color:red\">Warning (Note on Academic Misconduct):</h2>\n", + "\n", + "You are allowed to work with a partner on your projects.\n", + "While it is not required that you work with a partner, it is recommended that you find a project partner as soon as possible as the projects will get progressively harder.\n", + "Be careful not to work with more than one partner. If you work with a partner on Lab-P7, you are **not** allowed to finish your project with a different partner.\n", + "You may either continue to work with the same partner, or work on P7 alone. Now may be a good time to review [our course policies](https://cs220.cs.wisc.edu/s23/syllabus.html).\n", + "\n", + "Under any circumstances, **no more than two students are allowed to work together on a project** as mentioned in the course policies. If your code is flagged by our code similarity detection tools, **both partners will be responsible** for sharing/copying the code, even if the code is shared/copied by one of the partners with/from other non-partner student(s). Note that each case of plagiarism will be reported to the Dean of Students with a zero grade on the project. **If you think that someone cannot be your project partner then don’t make that student your lab partner.**" + ] + }, + { + "cell_type": "markdown", + "id": "d664e12b", "metadata": {}, "source": [ "## Segment 2: Loading Data from CSVs" @@ -43,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "1351a1b8", + "id": "01af64f2", "metadata": {}, "source": [ "## Dataset:\n", @@ -66,7 +81,7 @@ }, { "cell_type": "markdown", - "id": "8a9c84f4", + "id": "110334e9", "metadata": {}, "source": [ "### Task 2.1: Processing the CSV file\n", @@ -77,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0aa089dc", + "id": "d827dea8", "metadata": { "tags": [] }, @@ -90,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f3e22f27", + "id": "a30a32e1", "metadata": { "tags": [] }, @@ -102,7 +117,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f280cec", + "id": "94d7b47c", "metadata": { "tags": [] }, @@ -120,7 +135,7 @@ }, { "cell_type": "markdown", - "id": "5e520cfe", + "id": "ea3cde19", "metadata": {}, "source": [ "### Function 1: `cell(row_idx, col_name)`\n", @@ -147,7 +162,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7eb170ee", + "id": "5526193f", "metadata": { "tags": [] }, @@ -158,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "2ac78cc5", + "id": "46ee9178", "metadata": {}, "source": [ "### Task 2.2: Verifying the `cell` function\n", @@ -170,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "738e08d9", + "id": "a8ae7235", "metadata": {}, "source": [ "**Question 1.1:** What is the `year` for the *5*th data row?" @@ -179,7 +194,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9ceff330", + "id": "f8ff94aa", "metadata": { "tags": [] }, @@ -196,7 +211,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ee7c603", + "id": "2ef7c935", "metadata": { "deletable": false, "editable": false @@ -208,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "31c636bc", + "id": "c537fcf2", "metadata": {}, "source": [ "**Question 1.2:** What is the `pop` for the *6*th data row?" @@ -217,7 +232,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5fd64707", + "id": "d3988cdc", "metadata": { "tags": [] }, @@ -234,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c4eaa4a0", + "id": "5337c3be", "metadata": { "deletable": false, "editable": false @@ -246,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "e28bbe8f", + "id": "d46f8a3f", "metadata": {}, "source": [ "**Question 1.3:** What is the `urban_percent` for the *58*th data row?" @@ -255,7 +270,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d67929d6", + "id": "bcf0ef06", "metadata": { "tags": [] }, @@ -272,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b63f6c2c", + "id": "8c7d5802", "metadata": { "deletable": false, "editable": false @@ -284,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "494eee74", + "id": "e3845717", "metadata": {}, "source": [ "**Question 1.4:** What is the `national_alb` for the *59*th data row?" @@ -293,7 +308,7 @@ { "cell_type": "code", "execution_count": null, - "id": "612bda10", + "id": "ae4936cb", "metadata": { "tags": [] }, @@ -310,7 +325,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9216bf53", + "id": "edef6df0", "metadata": { "deletable": false, "editable": false @@ -322,7 +337,7 @@ }, { "cell_type": "markdown", - "id": "de8ae2c7", + "id": "f96550ea", "metadata": {}, "source": [ "**Question 1.5:** What is the `urban_alb` for the *59*th data row?" @@ -331,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f35a77d", + "id": "9f09428c", "metadata": { "tags": [] }, @@ -348,7 +363,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdfc467d", + "id": "5169dd6d", "metadata": { "deletable": false, "editable": false @@ -360,7 +375,7 @@ }, { "cell_type": "markdown", - "id": "408bd4ac", + "id": "da5edc84", "metadata": {}, "source": [ "**Question 1.6:** What is the `country_code` for the *60*th data row?" @@ -369,7 +384,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83a670ce", + "id": "443fe419", "metadata": { "tags": [] }, @@ -386,7 +401,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39252810", + "id": "dca05378", "metadata": { "deletable": false, "editable": false @@ -398,7 +413,7 @@ }, { "cell_type": "markdown", - "id": "d6b88bcd", + "id": "7d17de2b", "metadata": {}, "source": [ "**Question 1.7:** What is the `income_level` for the *60*th data row?" @@ -407,7 +422,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9821b4e", + "id": "7220fe6b", "metadata": { "tags": [] }, @@ -424,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0fe25c06", + "id": "75fda20e", "metadata": { "deletable": false, "editable": false @@ -436,7 +451,7 @@ }, { "cell_type": "markdown", - "id": "9a33e216", + "id": "c46f907e", "metadata": {}, "source": [ "## Segment 3: Dictionaries and Looping through Timeseries data" @@ -444,7 +459,7 @@ }, { "cell_type": "markdown", - "id": "e647279e", + "id": "5b9e45fb", "metadata": {}, "source": [ "### Task 3.1: Creating and Accessing Dictionaries" @@ -452,7 +467,7 @@ }, { "cell_type": "markdown", - "id": "0619cfd2", + "id": "e92c54cc", "metadata": {}, "source": [ "**Question 2:** Create a dictionary mapping each `country_name` to its `country_code`.\n", @@ -474,7 +489,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8dfd0aa1", + "id": "820bc288", "metadata": { "tags": [] }, @@ -482,7 +497,7 @@ "source": [ "# replace the ... with your code\n", "\n", - "# Initialize as an empty dictionary\n", + "# initialize as an empty dictionary\n", "country_codes = ...\n", "\n", "# this will loop through from 0 to len(csv_rows) and increase by 2 numbers each loop\n", @@ -502,7 +517,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4f6379f", + "id": "1fab4f52", "metadata": { "deletable": false, "editable": false @@ -514,7 +529,7 @@ }, { "cell_type": "markdown", - "id": "59349301", + "id": "7d5b3408", "metadata": {}, "source": [ "**Question 3.1:** What is the `country_code` of *Ireland*?" @@ -523,7 +538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fbc1cc74", + "id": "079b3967", "metadata": { "tags": [] }, @@ -538,7 +553,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b05afe8", + "id": "13bf0225", "metadata": { "deletable": false, "editable": false @@ -550,7 +565,7 @@ }, { "cell_type": "markdown", - "id": "0303a44c", + "id": "94d0b02d", "metadata": {}, "source": [ "**Question 3.2:** What is the country code of *Sudan*?" @@ -559,7 +574,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd47e2f5", + "id": "64288999", "metadata": { "tags": [] }, @@ -574,7 +589,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fb28427", + "id": "86f15199", "metadata": { "deletable": false, "editable": false @@ -586,7 +601,7 @@ }, { "cell_type": "markdown", - "id": "2e014f0d", + "id": "bb9333aa", "metadata": {}, "source": [ "**Question 4:** Create a dictionary mapping each `country_name` to `income_level` for *2015*.\n", @@ -608,7 +623,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59a07a28", + "id": "6edb4221", "metadata": { "tags": [] }, @@ -616,7 +631,7 @@ "source": [ "# replace the ... with your code\n", "\n", - "# Initialize as an empty dictionary\n", + "# initialize as an empty dictionary\n", "income_levels_2015 = ...\n", "\n", "# you need to loop through from 0 to len(csv_rows) and increase by 2 numbers each loop\n", @@ -635,7 +650,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eae6e56a", + "id": "b41b0368", "metadata": { "deletable": false, "editable": false @@ -647,7 +662,7 @@ }, { "cell_type": "markdown", - "id": "9bb241de", + "id": "90f90806", "metadata": {}, "source": [ "**Question 5:** Create a dictionary mapping each `country_name` to `income_level` for *2020*.\n", @@ -669,7 +684,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec6d35b8", + "id": "803adb85", "metadata": { "tags": [] }, @@ -677,7 +692,7 @@ "source": [ "# replace the ... with your code\n", "\n", - "# Initialize as an empty dictionary\n", + "# initialize as an empty dictionary\n", "income_levels_2020 = ...\n", "\n", "# you need to loop through from 1 to len(csv_rows) and increase by 2 numbers each loop\n", @@ -696,7 +711,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4cb3ac26", + "id": "7c5df206", "metadata": { "deletable": false, "editable": false @@ -708,7 +723,7 @@ }, { "cell_type": "markdown", - "id": "97d671ab", + "id": "5c6211c4", "metadata": {}, "source": [ "**Question 6.1:** What is the `income_level` of *Zimbabwe* in *2015*?" @@ -717,7 +732,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11cd8c43", + "id": "78550ba8", "metadata": { "tags": [] }, @@ -733,7 +748,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3c19bf0d", + "id": "484e9f50", "metadata": { "deletable": false, "editable": false @@ -745,7 +760,7 @@ }, { "cell_type": "markdown", - "id": "b31a09ea", + "id": "bb9e6305", "metadata": {}, "source": [ "**Question 6.2:** What is the `income_level` of *Zimbabwe* in *2020*?" @@ -754,7 +769,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ecce349b", + "id": "018d72de", "metadata": { "scrolled": true, "tags": [] @@ -771,7 +786,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e336e2b8", + "id": "fc466575", "metadata": { "deletable": false, "editable": false @@ -783,7 +798,7 @@ }, { "cell_type": "markdown", - "id": "1b653489", + "id": "ae2a6da4", "metadata": {}, "source": [ "### Task 3.2: Comparing data in odd and even indices" @@ -791,7 +806,7 @@ }, { "cell_type": "markdown", - "id": "331e6f66", + "id": "bf66654d", "metadata": {}, "source": [ "**Question 7:** Create a **list** of all the countries (`country_name`) whose populations (`pop`) have **decreased** from *2015* to *2020*." @@ -800,7 +815,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3025c600", + "id": "e8c35d1c", "metadata": { "tags": [] }, @@ -824,7 +839,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d880a4e", + "id": "3ad0e75a", "metadata": { "deletable": false, "editable": false @@ -836,7 +851,7 @@ }, { "cell_type": "markdown", - "id": "82c7b9cd", + "id": "013ee249", "metadata": {}, "source": [ "**Question 8:** Create a list of all the countries whose urban population percentage (`urban_percent`) **increased** from *2015* to *2020*." @@ -845,7 +860,7 @@ { "cell_type": "code", "execution_count": null, - "id": "852f6ee0", + "id": "c4088865", "metadata": { "tags": [] }, @@ -854,7 +869,7 @@ "# replace the ... with your code\n", "\n", "# initialize as an empty list\n", - "more_urban_countries = []\n", + "more_urban_countries = ...\n", "\n", "# you need to loop through only even (or only odd) indices to avoid repeating the same steps twice\n", "# and add the country_name to the list if urban_percent is higher in 2020 than in 2015\n", @@ -865,7 +880,7 @@ { "cell_type": "code", "execution_count": null, - "id": "652c4cb9", + "id": "1b19bad4", "metadata": { "deletable": false, "editable": false @@ -877,7 +892,7 @@ }, { "cell_type": "markdown", - "id": "a08a32d9", + "id": "abf95172", "metadata": {}, "source": [ "### Task 3.3: Working with Nested Dictionaries\n", @@ -887,7 +902,7 @@ }, { "cell_type": "markdown", - "id": "7b837291", + "id": "e3fb0eb3", "metadata": {}, "source": [ "**Question 9:** Create a dictionary mapping each `country_name` to another **dictionary** that maps each `year` to `income_level`. You may hardcode the years *2015* and *2020* for this question.\n", @@ -907,7 +922,7 @@ { "cell_type": "code", "execution_count": null, - "id": "af3b24fd", + "id": "7baf2d55", "metadata": { "tags": [] }, @@ -936,7 +951,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3fc64163", + "id": "d3d2f3a6", "metadata": { "deletable": false, "editable": false @@ -948,7 +963,7 @@ }, { "cell_type": "markdown", - "id": "7c9c233a", + "id": "d9142e85", "metadata": {}, "source": [ "**Question 10.1:** Use the nested dictionary you created to find the `income_level` of *Cuba* in *2015*.\n", @@ -959,7 +974,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0c0a8465", + "id": "c2f0b6c4", "metadata": { "tags": [] }, @@ -975,7 +990,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d43224a", + "id": "684ec02d", "metadata": { "deletable": false, "editable": false @@ -987,7 +1002,7 @@ }, { "cell_type": "markdown", - "id": "581a552c", + "id": "d5e07fdf", "metadata": {}, "source": [ "**Question 10.2:** Use the nested dictionary you created to find the `income_level` of *Gibraltar* in *2020*.\n", @@ -998,7 +1013,7 @@ { "cell_type": "code", "execution_count": null, - "id": "633781b9", + "id": "d6b9a626", "metadata": { "scrolled": false, "tags": [] @@ -1015,7 +1030,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0b9776d8", + "id": "b8dbe507", "metadata": { "deletable": false, "editable": false @@ -1027,7 +1042,7 @@ }, { "cell_type": "markdown", - "id": "11801822", + "id": "454d7f1b", "metadata": {}, "source": [ "**Question 11**: Create a dictionary mapping each `country_name` to a **boolean** representing whether or not the `income_level` of a country is different in *2020* than in *2015*.\n", @@ -1049,7 +1064,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b919e60", + "id": "d98c09e1", "metadata": { "tags": [] }, @@ -1076,7 +1091,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ee8c425", + "id": "6f32db0c", "metadata": { "deletable": false, "editable": false @@ -1088,7 +1103,7 @@ }, { "cell_type": "markdown", - "id": "93ac9ecf", + "id": "1858bf1d", "metadata": {}, "source": [ "### Task 3.4: Binning\n", @@ -1104,7 +1119,7 @@ }, { "cell_type": "markdown", - "id": "4e6ce90a", + "id": "27a8890a", "metadata": {}, "source": [ "**Question 12:** Create a new dictionary using the `income_levels_2015` dictionary by mapping each `income_level` to a **list** of all the countries (`country_name`) from that `income_level`.\n", @@ -1130,7 +1145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01d85153", + "id": "3b6d451b", "metadata": { "tags": [] }, @@ -1157,7 +1172,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92a471bc", + "id": "f0a3d10e", "metadata": { "deletable": false, "editable": false @@ -1169,7 +1184,7 @@ }, { "cell_type": "markdown", - "id": "26613d73", + "id": "a59306ba", "metadata": {}, "source": [ "**Question 13:** Create a new dictionary using the `income_levels_2020` dictionary by mapping each `income_level` to a **list** of all the countries (`country_name`) from that `income_level`." @@ -1178,7 +1193,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ddcdfea", + "id": "073b30c1", "metadata": { "tags": [] }, @@ -1198,7 +1213,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18774dde", + "id": "09b1b653", "metadata": { "deletable": false, "editable": false @@ -1210,7 +1225,7 @@ }, { "cell_type": "markdown", - "id": "013d9a9a", + "id": "4990f890", "metadata": {}, "source": [ "### Task 3.5: Summarizing Data in Dictionaries" @@ -1218,7 +1233,7 @@ }, { "cell_type": "markdown", - "id": "fe5e5aea", + "id": "ed72cf98", "metadata": {}, "source": [ "**Question 14.1:** Create a new dictionary that maps each `income_level` to the **number** of countries from that `income_level` in *2015*.\n", @@ -1237,7 +1252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "030b86ec", + "id": "616249f4", "metadata": { "tags": [] }, @@ -1259,7 +1274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f03f9888", + "id": "136ced46", "metadata": { "deletable": false, "editable": false @@ -1271,7 +1286,7 @@ }, { "cell_type": "markdown", - "id": "9d5980a3", + "id": "600a2866", "metadata": {}, "source": [ "**Question 14.2**: Create a new dictionary that maps each `income_level` to the **number** of countries from that `income_level` in *2020*.\n", @@ -1289,7 +1304,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d43db4d0", + "id": "d5b8fd9a", "metadata": { "tags": [] }, @@ -1309,7 +1324,7 @@ { "cell_type": "code", "execution_count": null, - "id": "768b351f", + "id": "06f1ea95", "metadata": { "deletable": false, "editable": false @@ -1321,7 +1336,7 @@ }, { "cell_type": "markdown", - "id": "beb6ea2d", + "id": "39a19b6e", "metadata": {}, "source": [ "### Task 3.6: Combining data from different dictionaries" @@ -1329,7 +1344,7 @@ }, { "cell_type": "markdown", - "id": "fef61793", + "id": "b399334a", "metadata": {}, "source": [ "**Question 15.1:** Create a dictionary that maps each `country_name` to the population (`pop`) of that country in *2020*.\n", @@ -1352,7 +1367,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aae1145e", + "id": "f6fe6dd7", "metadata": { "tags": [] }, @@ -1372,7 +1387,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b4aef3d9", + "id": "30dd5636", "metadata": { "deletable": false, "editable": false @@ -1384,7 +1399,7 @@ }, { "cell_type": "markdown", - "id": "300d21d6", + "id": "78114503", "metadata": {}, "source": [ "**Question 15.2:** Create a dictionary that maps each `country_name` to the urban population percentage (`urban_percent`) of that country in *2020*.\n", @@ -1404,7 +1419,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2c081c7", + "id": "ffec4995", "metadata": { "tags": [] }, @@ -1416,7 +1431,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3da62fe1", + "id": "4e6f7f7d", "metadata": { "deletable": false, "editable": false @@ -1428,7 +1443,7 @@ }, { "cell_type": "markdown", - "id": "978bc4e4", + "id": "fae0ea0d", "metadata": {}, "source": [ "**Question 16:** Using the two dictionaries `pops` and `urban_percents`, create a new dictionary that maps each `country_name` to the size of the urban population of that country in *2020*.\n", @@ -1452,7 +1467,7 @@ { "cell_type": "code", "execution_count": null, - "id": "528640c8", + "id": "cb36dd13", "metadata": { "tags": [] }, @@ -1476,7 +1491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5ac2fee4", + "id": "a2dcc2e3", "metadata": { "deletable": false, "editable": false @@ -1488,7 +1503,7 @@ }, { "cell_type": "markdown", - "id": "f0aa7a87", + "id": "e5084c01", "metadata": {}, "source": [ "### Task 3.7: Finding Minimum/Maximum Values in Dictionaries" @@ -1496,7 +1511,7 @@ }, { "cell_type": "markdown", - "id": "56afff02", + "id": "33a93189", "metadata": {}, "source": [ "**Question 17**: What is the name of the country with the **smallest** urban population? Do not worry about ties." @@ -1505,7 +1520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c72ab99", + "id": "2b49ffda", "metadata": { "tags": [] }, @@ -1529,7 +1544,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ecf8d6c", + "id": "4103d5e8", "metadata": { "deletable": false, "editable": false @@ -1541,7 +1556,7 @@ }, { "cell_type": "markdown", - "id": "3d68a87d", + "id": "ac68a198", "metadata": {}, "source": [ "**Question 18**: What is the name of the country with the **largest** urban population? Do not worry about ties." @@ -1550,7 +1565,7 @@ { "cell_type": "code", "execution_count": null, - "id": "541fca56", + "id": "01ab12e3", "metadata": { "tags": [] }, @@ -1562,7 +1577,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1036293", + "id": "6720cfa5", "metadata": { "deletable": false, "editable": false @@ -1574,7 +1589,7 @@ }, { "cell_type": "markdown", - "id": "34a60617", + "id": "f21e48ac", "metadata": {}, "source": [ "### Task 3.8: Adding additional data to nested dictionaries\n", @@ -1586,7 +1601,7 @@ }, { "cell_type": "markdown", - "id": "b47b88b7", + "id": "93d01825", "metadata": {}, "source": [ "**Question 19**: Add an additional key-value pair mapping the string `\"region\"` to the `region` of each country to each of the inner dictionaries of `income_levels`.\n", @@ -1610,7 +1625,7 @@ { "cell_type": "code", "execution_count": null, - "id": "002bfe6a", + "id": "8b33c18c", "metadata": { "tags": [] }, @@ -1622,7 +1637,7 @@ { "cell_type": "code", "execution_count": null, - "id": "edb4964c", + "id": "31969d84", "metadata": { "deletable": false, "editable": false @@ -1634,7 +1649,7 @@ }, { "cell_type": "markdown", - "id": "14a4af04", + "id": "46d804e2", "metadata": {}, "source": [ "### Task 3.9: More binning" @@ -1642,7 +1657,7 @@ }, { "cell_type": "markdown", - "id": "75996b30", + "id": "cb144321", "metadata": {}, "source": [ "**Question 20**: Create a new dictionary that maps each `region` to the **list** of countries from that region whose `income_level` was *Lower middle income* in *2020*." @@ -1651,7 +1666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f373083c", + "id": "527c8af6", "metadata": { "tags": [] }, @@ -1678,7 +1693,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aad9a4ed", + "id": "89020267", "metadata": { "deletable": false, "editable": false @@ -1690,7 +1705,7 @@ }, { "cell_type": "markdown", - "id": "273e0384", + "id": "723e7029", "metadata": {}, "source": [ "## Great work! You are now ready to start [P7](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-s23-projects/-/tree/main/p7). You may use any helper functions that you have created here." diff --git a/p7/p7.ipynb b/p7/p7.ipynb index 6d8d8526ee2d42c56bb3c054464a6d421e6c3f73..a692a0c3f40538c98975e34f35fcb3a6daed3b0d 100644 --- a/p7/p7.ipynb +++ b/p7/p7.ipynb @@ -3,7 +3,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4ec2178b", + "id": "aa4b9e67", "metadata": { "cell_type": "code", "deletable": false, @@ -19,7 +19,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4098a8db", + "id": "e68a05ee", "metadata": { "deletable": false, "editable": false @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f080923f", + "id": "0bda81e5", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "12654767", + "id": "2bd52538", "metadata": { "deletable": false, "editable": false @@ -57,7 +57,7 @@ }, { "cell_type": "markdown", - "id": "2b970d5d", + "id": "6de27486", "metadata": { "deletable": false, "editable": false @@ -74,7 +74,7 @@ }, { "cell_type": "markdown", - "id": "d997f9d6", + "id": "1da5578b", "metadata": { "deletable": false, "editable": false @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "60ecd7f7", + "id": "07e92321", "metadata": { "deletable": false, "editable": false @@ -98,7 +98,20 @@ }, { "cell_type": "markdown", - "id": "8c9d3711", + "id": "f49d4b3d", + "metadata": { + "deletable": false, + "editable": false + }, + "source": [ + "<h2 style=\"color:red\">Warning (Note on Academic Misconduct):</h2>\n", + "\n", + "Under any circumstances, **no more than two students are allowed to work together on a project** as mentioned in the course policies. If your code is flagged by our code similarity detection tools, **both partners will be responsible** for sharing/copying the code, even if the code is shared/copied by one of the partners with/from other non-partner student(s). Note that each case of plagiarism will be reported to the Dean of Students with a zero grade on the project. **If you think that someone cannot be your project partner then don’t make that student your lab partner.**" + ] + }, + { + "cell_type": "markdown", + "id": "d1d2a7eb", "metadata": { "deletable": false, "editable": false @@ -115,7 +128,7 @@ }, { "cell_type": "markdown", - "id": "1abbab4c", + "id": "90f93012", "metadata": { "deletable": false, "editable": false @@ -139,7 +152,7 @@ }, { "cell_type": "markdown", - "id": "3226285c", + "id": "afd5622a", "metadata": { "deletable": false, "editable": false @@ -172,7 +185,7 @@ }, { "cell_type": "markdown", - "id": "30a1f9b6", + "id": "91284e1c", "metadata": { "deletable": false, "editable": false @@ -191,7 +204,7 @@ }, { "cell_type": "markdown", - "id": "301913cb", + "id": "c13abf13", "metadata": { "deletable": false, "editable": false @@ -203,7 +216,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6db03afc", + "id": "38aa88e9", "metadata": { "tags": [] }, @@ -215,7 +228,7 @@ }, { "cell_type": "markdown", - "id": "84fc95f0", + "id": "b40c6dce", "metadata": { "deletable": false, "editable": false @@ -227,7 +240,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1bee769c", + "id": "316f9f5c", "metadata": { "tags": [] }, @@ -248,7 +261,7 @@ }, { "cell_type": "markdown", - "id": "899b98a0", + "id": "70c06cd9", "metadata": { "deletable": false, "editable": false @@ -266,7 +279,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d660407", + "id": "ca41db56", "metadata": { "tags": [] }, @@ -277,7 +290,7 @@ }, { "cell_type": "markdown", - "id": "22319e1e", + "id": "1eb3deba", "metadata": { "deletable": false, "editable": false @@ -289,7 +302,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f8f552c", + "id": "2d72e97b", "metadata": { "tags": [] }, @@ -306,7 +319,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b69f3c64", + "id": "bb74a9e7", "metadata": { "deletable": false, "editable": false @@ -318,7 +331,7 @@ }, { "cell_type": "markdown", - "id": "029ef4df", + "id": "f8d0b16f", "metadata": { "deletable": false, "editable": false @@ -329,7 +342,7 @@ }, { "cell_type": "markdown", - "id": "ec0db606", + "id": "9d0efb5b", "metadata": { "deletable": false, "editable": false @@ -341,7 +354,7 @@ { "cell_type": "code", "execution_count": null, - "id": "267544c7", + "id": "47987a22", "metadata": { "tags": [] }, @@ -353,7 +366,7 @@ { "cell_type": "code", "execution_count": null, - "id": "823559e7", + "id": "8552a500", "metadata": { "deletable": false, "editable": false @@ -365,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "541486f4", + "id": "dee1647d", "metadata": { "deletable": false, "editable": false @@ -381,7 +394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "166a98dd", + "id": "6cb9dd7a", "metadata": { "tags": [] }, @@ -393,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5021ef50", + "id": "9c1c6497", "metadata": { "deletable": false, "editable": false @@ -405,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "1a6716cb", + "id": "b50acbc5", "metadata": { "deletable": false, "editable": false @@ -421,7 +434,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c2066e60", + "id": "7f2ef785", "metadata": { "tags": [] }, @@ -433,7 +446,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0bab1616", + "id": "e36ddb30", "metadata": { "deletable": false, "editable": false @@ -445,7 +458,7 @@ }, { "cell_type": "markdown", - "id": "9dc35fc4", + "id": "4bba9ee3", "metadata": { "deletable": false, "editable": false @@ -459,7 +472,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e8927dd", + "id": "abe5a4ed", "metadata": { "tags": [] }, @@ -471,7 +484,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e558e594", + "id": "2d6efed9", "metadata": { "deletable": false, "editable": false @@ -483,7 +496,7 @@ }, { "cell_type": "markdown", - "id": "72a83cc4", + "id": "deca9ecc", "metadata": { "deletable": false, "editable": false @@ -497,7 +510,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbc9f7d5", + "id": "38e85879", "metadata": { "tags": [] }, @@ -509,7 +522,7 @@ { "cell_type": "code", "execution_count": null, - "id": "495a9cc2", + "id": "b1e8600b", "metadata": { "deletable": false, "editable": false @@ -521,7 +534,7 @@ }, { "cell_type": "markdown", - "id": "6fd46918", + "id": "c496f364", "metadata": { "deletable": false, "editable": false @@ -537,7 +550,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59597ee6", + "id": "1c6623f6", "metadata": { "tags": [] }, @@ -549,7 +562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "51239c61", + "id": "344323a3", "metadata": { "deletable": false, "editable": false @@ -561,7 +574,7 @@ }, { "cell_type": "markdown", - "id": "43f8cde2", + "id": "72e81551", "metadata": { "deletable": false, "editable": false @@ -575,7 +588,7 @@ { "cell_type": "code", "execution_count": null, - "id": "972f9e3f", + "id": "fd0a5d9d", "metadata": { "tags": [] }, @@ -587,7 +600,7 @@ { "cell_type": "code", "execution_count": null, - "id": "625825be", + "id": "dbe51f29", "metadata": { "deletable": false, "editable": false @@ -599,7 +612,7 @@ }, { "cell_type": "markdown", - "id": "c832901b", + "id": "a5b16acd", "metadata": { "deletable": false, "editable": false @@ -615,7 +628,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6f5df91", + "id": "90350b24", "metadata": { "tags": [] }, @@ -627,7 +640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6e3c7f47", + "id": "bd8df15c", "metadata": { "deletable": false, "editable": false @@ -639,7 +652,7 @@ }, { "cell_type": "markdown", - "id": "23bce21c", + "id": "2374c56e", "metadata": { "deletable": false, "editable": false @@ -653,7 +666,7 @@ { "cell_type": "code", "execution_count": null, - "id": "574514c6", + "id": "960caebf", "metadata": { "tags": [] }, @@ -665,7 +678,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70816313", + "id": "7348bbdc", "metadata": { "deletable": false, "editable": false @@ -677,7 +690,7 @@ }, { "cell_type": "markdown", - "id": "505aefcf", + "id": "0010cb5e", "metadata": { "deletable": false, "editable": false @@ -725,7 +738,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6ea7d480", + "id": "b1d53dae", "metadata": { "tags": [] }, @@ -746,7 +759,7 @@ }, { "cell_type": "markdown", - "id": "4da85178", + "id": "2e90ac41", "metadata": { "deletable": false, "editable": false @@ -758,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c8c01873", + "id": "b7ae6fb4", "metadata": { "tags": [] }, @@ -772,7 +785,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ffb16361", + "id": "79dcec3e", "metadata": { "deletable": false, "editable": false @@ -784,7 +797,7 @@ }, { "cell_type": "markdown", - "id": "fd5d8dbe", + "id": "d171f93a", "metadata": { "deletable": false, "editable": false @@ -832,7 +845,7 @@ { "cell_type": "code", "execution_count": null, - "id": "db358fa4", + "id": "bed68d29", "metadata": { "tags": [] }, @@ -855,7 +868,7 @@ }, { "cell_type": "markdown", - "id": "582e6dd2", + "id": "d3c2492b", "metadata": { "deletable": false, "editable": false @@ -867,7 +880,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b82de8b", + "id": "58713866", "metadata": { "deletable": false, "editable": false @@ -879,7 +892,7 @@ }, { "cell_type": "markdown", - "id": "7e4d448a", + "id": "07e3a798", "metadata": { "deletable": false, "editable": false @@ -905,7 +918,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d9d1fa73", + "id": "7ca9c02f", "metadata": { "tags": [] }, @@ -918,7 +931,7 @@ }, { "cell_type": "markdown", - "id": "27206e45", + "id": "60a3c5d3", "metadata": { "deletable": false, "editable": false @@ -930,7 +943,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f7f2590c", + "id": "1e68e7dd", "metadata": { "deletable": false, "editable": false @@ -942,7 +955,7 @@ }, { "cell_type": "markdown", - "id": "f5823f27", + "id": "422e0f61", "metadata": { "deletable": false, "editable": false @@ -953,7 +966,7 @@ }, { "cell_type": "markdown", - "id": "122010ce", + "id": "b666a840", "metadata": { "deletable": false, "editable": false @@ -979,7 +992,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f92792a", + "id": "4f9095c3", "metadata": { "tags": [] }, @@ -991,7 +1004,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e0db750", + "id": "e9c1feb6", "metadata": { "deletable": false, "editable": false @@ -1003,7 +1016,7 @@ }, { "cell_type": "markdown", - "id": "1c6f7551", + "id": "7912771d", "metadata": { "deletable": false, "editable": false @@ -1015,7 +1028,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6afb44a6", + "id": "01badb20", "metadata": { "tags": [] }, @@ -1027,7 +1040,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8628138d", + "id": "a8b8b903", "metadata": { "deletable": false, "editable": false @@ -1039,7 +1052,7 @@ }, { "cell_type": "markdown", - "id": "a1c2a622", + "id": "ef819bad", "metadata": { "deletable": false, "editable": false @@ -1051,7 +1064,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d227a6e", + "id": "2cafae07", "metadata": { "tags": [] }, @@ -1063,7 +1076,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a621aa32", + "id": "a11231ab", "metadata": { "deletable": false, "editable": false @@ -1075,7 +1088,7 @@ }, { "cell_type": "markdown", - "id": "1bac50ce", + "id": "3c38b8c1", "metadata": { "deletable": false, "editable": false @@ -1089,7 +1102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e2244625", + "id": "b68d867e", "metadata": { "tags": [] }, @@ -1101,7 +1114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ac9595f", + "id": "f1fb4c8c", "metadata": { "deletable": false, "editable": false @@ -1113,7 +1126,7 @@ }, { "cell_type": "markdown", - "id": "4355a333", + "id": "ca853253", "metadata": { "deletable": false, "editable": false @@ -1131,7 +1144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2163db33", + "id": "f3612c98", "metadata": { "tags": [] }, @@ -1143,7 +1156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43d09315", + "id": "2c66e6d4", "metadata": { "deletable": false, "editable": false @@ -1155,7 +1168,7 @@ }, { "cell_type": "markdown", - "id": "2fc75f18", + "id": "a045c086", "metadata": { "deletable": false, "editable": false @@ -1171,7 +1184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8fc6a590", + "id": "3ed16adc", "metadata": { "tags": [] }, @@ -1183,7 +1196,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cce208df", + "id": "bb057833", "metadata": { "deletable": false, "editable": false @@ -1195,7 +1208,7 @@ }, { "cell_type": "markdown", - "id": "a25919a2", + "id": "83143982", "metadata": { "deletable": false, "editable": false @@ -1219,7 +1232,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f897e182", + "id": "2c158007", "metadata": { "tags": [] }, @@ -1232,7 +1245,7 @@ }, { "cell_type": "markdown", - "id": "873d577f", + "id": "1b0697ec", "metadata": { "deletable": false, "editable": false @@ -1244,7 +1257,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f819df98", + "id": "3756f06e", "metadata": { "deletable": false, "editable": false @@ -1256,7 +1269,7 @@ }, { "cell_type": "markdown", - "id": "8ec2d557", + "id": "224bada8", "metadata": { "deletable": false, "editable": false @@ -1270,7 +1283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82e8a1ed", + "id": "5f1e4c0b", "metadata": { "tags": [] }, @@ -1282,7 +1295,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39afe0ed", + "id": "c5c37780", "metadata": { "deletable": false, "editable": false @@ -1294,7 +1307,7 @@ }, { "cell_type": "markdown", - "id": "89ad1d5d", + "id": "bcbed813", "metadata": { "deletable": false, "editable": false @@ -1318,7 +1331,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b87087c6", + "id": "7809dc36", "metadata": { "tags": [] }, @@ -1340,7 +1353,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3494a2e3", + "id": "20737850", "metadata": { "tags": [] }, @@ -1351,7 +1364,7 @@ }, { "cell_type": "markdown", - "id": "0587f1dc", + "id": "47274c60", "metadata": { "deletable": false, "editable": false @@ -1363,7 +1376,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a645c3e", + "id": "9b1d43d7", "metadata": { "deletable": false, "editable": false @@ -1375,7 +1388,7 @@ }, { "cell_type": "markdown", - "id": "852082e7", + "id": "ba0832bb", "metadata": { "deletable": false, "editable": false @@ -1389,7 +1402,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3d3cb290", + "id": "d7cd2af1", "metadata": { "tags": [] }, @@ -1401,7 +1414,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b39a0f5", + "id": "6a13bfc3", "metadata": { "deletable": false, "editable": false @@ -1413,7 +1426,7 @@ }, { "cell_type": "markdown", - "id": "cfa77a6b", + "id": "79ca0068", "metadata": { "deletable": false, "editable": false @@ -1429,7 +1442,7 @@ { "cell_type": "code", "execution_count": null, - "id": "df205363", + "id": "5f0a7e59", "metadata": { "tags": [] }, @@ -1441,7 +1454,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ac4cbbb5", + "id": "fa5d6c6c", "metadata": { "deletable": false, "editable": false @@ -1453,7 +1466,7 @@ }, { "cell_type": "markdown", - "id": "b7a2eb11", + "id": "c4911079", "metadata": { "deletable": false, "editable": false @@ -1472,7 +1485,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9394c718", + "id": "9467d41d", "metadata": { "tags": [] }, @@ -1484,7 +1497,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70db3d66", + "id": "b8d4d3b4", "metadata": { "deletable": false, "editable": false @@ -1496,7 +1509,7 @@ }, { "cell_type": "markdown", - "id": "471a1681", + "id": "99fb75f2", "metadata": { "deletable": false, "editable": false @@ -1510,7 +1523,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6fc48d32", + "id": "4954b362", "metadata": { "tags": [] }, @@ -1522,7 +1535,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aca62588", + "id": "786d8ab1", "metadata": { "deletable": false, "editable": false @@ -1534,7 +1547,7 @@ }, { "cell_type": "markdown", - "id": "9e4b8059", + "id": "2a5eeeb8", "metadata": { "deletable": false, "editable": false @@ -1552,7 +1565,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e515e70", + "id": "6fa71adc", "metadata": { "cell_type": "code" }, @@ -1566,7 +1579,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ba9d60ae", + "id": "cf92c956", "metadata": { "cell_type": "code", "deletable": false, @@ -1580,7 +1593,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34403430", + "id": "da0a9c58", "metadata": { "cell_type": "code", "deletable": false, @@ -1594,7 +1607,7 @@ }, { "cell_type": "markdown", - "id": "38a140ba", + "id": "bd82abcc", "metadata": { "deletable": false, "editable": false