From edfc67f91974aecbdcdfe7380469db3793d8f967 Mon Sep 17 00:00:00 2001
From: Tom van Woudenberg <t.r.vanwoudenberg@tudelft.nl>
Date: Thu, 12 Sep 2024 16:48:12 +0200
Subject: [PATCH] Finalized PA

---
 ...Clearning_and_Boosting_Productivity.ipynb} | 133 ++-
 content/week_1_3/PA_1_3_solution.ipynb        | 852 ++++++++++++++++++
 .../week_1_3/{ => auxiliary_files}/data_2.csv |   0
 3 files changed, 914 insertions(+), 71 deletions(-)
 rename content/week_1_3/{PA_1_3_Data_Cleaning_and_Boosting_Productivity.ipynb => PA_1_3_Data_Clearning_and_Boosting_Productivity.ipynb} (81%)
 create mode 100644 content/week_1_3/PA_1_3_solution.ipynb
 rename content/week_1_3/{ => auxiliary_files}/data_2.csv (100%)

diff --git a/content/week_1_3/PA_1_3_Data_Cleaning_and_Boosting_Productivity.ipynb b/content/week_1_3/PA_1_3_Data_Clearning_and_Boosting_Productivity.ipynb
similarity index 81%
rename from content/week_1_3/PA_1_3_Data_Cleaning_and_Boosting_Productivity.ipynb
rename to content/week_1_3/PA_1_3_Data_Clearning_and_Boosting_Productivity.ipynb
index 49b4fb6d..951a2037 100644
--- a/content/week_1_3/PA_1_3_Data_Cleaning_and_Boosting_Productivity.ipynb
+++ b/content/week_1_3/PA_1_3_Data_Clearning_and_Boosting_Productivity.ipynb
@@ -28,7 +28,7 @@
    "source": [
     "This PA consists of two parts:\n",
     " - Data Cleaning, with task 1.1 - 2.6\n",
-    " - Boosting Productivity, with task 3.1 - 3.10"
+    " - Boosting Productivity, with task ..."
    ]
   },
   {
@@ -67,7 +67,7 @@
    "source": [
     "### Task 1: Importing and Cleaning the array\n",
     "\n",
-    "In a previous week we looked at how to read in data from a csv, plot a nice graph and even find the $R^2$ of the data. This week, an eager botany student, Johnathan, has asked us to help him analyze some data: 1000 measurements have just been completed over the 100 m of greenhouse and are ready to use in `data_2.csv`. Jonathan happens to have a lot of free time but not that much experience taking measurements. Thus, there is some noise in the data and some problematic data that are a result of an error in the measurement device. Let's help them out!"
+    "In a previous week we looked at how to read in data from a csv, plot a nice graph and even find the $R^2$ of the data. This week an eager botany student, Johnathan, has asked us to help him analyze some data: 1000 measurements have just been completed over the 100m of greenhouse and are ready to use in `data_2.csv`. Johnathan happens to have a lot of free time but not that much experience taking measurements. Thus, there is some noise in the data and some problematic data that are a result of an error in the measurement device. Let's help them out!"
    ]
   },
   {
@@ -78,7 +78,7 @@
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
     "<p>\n",
     "<b>Task 1.1:</b>   \n",
-    "Import the data as 2 numpy arrays: distance and temperature. Tip, makes use of the function <code>numpy.genfromtxt</code>.\n",
+    "Import the data as 2 numpy arrays: distance and temperature.\n",
     "</p>\n",
     "</div>"
    ]
@@ -90,7 +90,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "distance, temperature = YOUR_CODE_HERE #np.genfromtxt(\"data_2.csv\", skip_header = 1, delimiter=\",\", unpack=True)"
+    "distance, temperature = YOUR_CODE_HERE"
    ]
   },
   {
@@ -113,7 +113,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "YOUR_CODE_HERE #temperature.size"
+    "YOUR_CODE_HERE"
    ]
   },
   {
@@ -124,7 +124,7 @@
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
     "<p>\n",
     "<b>Task 1.3:</b>   \n",
-    " Check if there are NaN (not a number) values in the temperature array. You can use the numpy method <code>isnan</code>, which returns a boolean vector (False if it is not a NaN, and True if it is a NaN). Save the result in the variable <code>temperature_is_nan</code>. The code block below will also help you inspect the results.\n",
+    " Check by defining a variable <code>boolean</code> using the numpy method <code>isnan</code>, which returns a boolean vector (False if it is not a NaN, and True if it is a NaN). The code block below will also help you inspect the results.\n",
     "</p>\n",
     "</div>"
    ]
@@ -136,10 +136,10 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "temperature_is_nan = YOUR_CODE_HERE #np.isnan(temperature)\n",
+    "boolean = YOUR_CODE_HERE\n",
     "\n",
-    "print(\"The first 10 values are:\", temperature_is_nan[0:10])\n",
-    "print(f\"There are {temperature_is_nan.sum()} NaNs in array temperature\")"
+    "print(\"The first 10 values are:\", boolean[0:10])\n",
+    "print(f\"There are {boolean.sum()} NaNs in array temperature\")"
    ]
   },
   {
@@ -147,7 +147,7 @@
    "id": "c9f8994b",
    "metadata": {},
    "source": [
-    "Let's slice the array using the `temperature_is_nan` array we just found to eliminate the NaNs. We can use the symbol `~`, which denotes the opposite: we want to keep those where np.isnan gives False as an answer."
+    "Let's slice the array using the `boolean` array we just found to eliminate the NaNs. We can use the symbol `~`, which denotes the opposite: we want to keep those where np.isnan gives False as an answer."
    ]
   },
   {
@@ -157,7 +157,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "temperature = temperature[~temperature_is_nan]"
+    "temperature = temperature[~boolean]"
    ]
   },
   {
@@ -182,7 +182,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "YOUR_CODE_HERE #temperature.size\n"
+    "YOUR_CODE_HERE"
    ]
   },
   {
@@ -200,7 +200,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "distance.size == temperature.size"
+    "distance.size==temperature.size"
    ]
   },
   {
@@ -208,7 +208,7 @@
    "id": "8a80b2d6",
    "metadata": {},
    "source": [
-    "Also, we don't know what the index of the removed values were, since we over-wrote `temperature`! Luckily we have our `temeprature_is_nan` array, which records the indices with Nans, which we can also use to update our `distance` array."
+    "Also, we don't know what the index of the removed values were, since we over-wrote `temperature`! Luckily we have our `boolean` array, which records the indices with Nans, which we can also use to update our `distance` array."
    ]
   },
   {
@@ -231,7 +231,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "distance = YOUR_CODE_HERE #distance[~temperature_is_nan]\n",
+    "distance = YOUR_CODE_HERE\n",
     "distance.size==temperature.size"
    ]
   },
@@ -252,10 +252,10 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "plt.plot(distance, temperature, \"ok\", label=\"Temperature\")\n",
+    "plt.plot(distance, temperature, \"ok\", label = 'Temperature')\n",
     "plt.title(\"Super duper greenhouse\")\n",
-    "plt.xlabel(\"Distance\")\n",
-    "plt.ylabel(\"Temperature\")\n",
+    "plt.xlabel('Distance')\n",
+    "plt.ylabel('Temperature')\n",
     "plt.show()"
    ]
   },
@@ -283,9 +283,9 @@
    "id": "9e8d396a",
    "metadata": {},
    "source": [
-    "The values are suspcious since they are +/-999...this is a common error code with some sensors, so we can assume that they can be removed from the dataset. We can easily remove these erroneous values of temperature, but this time we will use a different method than before. The exclamation mark before an equal sign, `!=`, denotes \"not equal to.\" We can use this as a logic operator to directly eliminate the values in one line. For example:\n",
+    "The values are suspcious since they are +/-999...this is a common error code with some sensors, so we can assume that they can be removed from the dataset. We can easily remove these erroneous values of temperature, but this time we will use a different method than before. The explamation mark before an equals sig, `!=`, denotes \"not equal to.\" We can use this as a logic operator to directly eliminate the values in one line. For example:\n",
     "```\n",
-    "array_1 = array_1[array_2 != -999]\n",
+    "array_1 = array_1[array_2!=-999]\n",
     "```"
    ]
   },
@@ -309,8 +309,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "YOUR_CODE_HERE #distance = distance[temperature != -999]\n",
-    "YOUR_CODE_HERE #temperature = temperature[temperature != -999]"
+    "YOUR_CODE_HERE\n",
+    "YOUR_CODE_HERE"
    ]
   },
   {
@@ -328,7 +328,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "print(distance.size == temperature.size)\n",
+    "print(distance.size==temperature.size)\n",
     "temperature.size"
    ]
   },
@@ -368,7 +368,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "mask = YOUR_CODE_HERE # (temperature != 999)\n",
+    "mask = YOUR_CODE_HERE\n",
     "distance = distance[mask]\n",
     "temperature = temperature[mask]"
    ]
@@ -378,7 +378,7 @@
    "id": "830e00fd",
    "metadata": {},
    "source": [
-    "The array is named \"mask\" because this process utilizes **masked arrays**...you can read more about it [here](https://python.plainenglish.io/numpy-masks-in-python-d8c13509fbc8)."
+    "The array is names \"mask\" because this process utilizes **masked arrays**...you can read more about it [here](https://python.plainenglish.io/numpy-masks-in-python-d8c13509fbc8)."
    ]
   },
   {
@@ -396,10 +396,10 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "plt.plot(distance, temperature, \"ok\", label=\"Temperature\")\n",
+    "plt.plot(distance, temperature, \"ok\", label = 'Temperature')\n",
     "plt.title(\"Super duper greenhouse\")\n",
-    "plt.xlabel(\"Distance\")\n",
-    "plt.ylabel(\"Temperature\")\n",
+    "plt.xlabel('Distance')\n",
+    "plt.ylabel('Temperature')\n",
     "plt.show()"
    ]
   },
@@ -408,7 +408,7 @@
    "id": "999da984",
    "metadata": {},
    "source": [
-    "Looks good! But wait—there also appear to be some values in the array that are not physically possible! We know for sure that there was nothing cold in the greenhouse during the measurements; also it's very likely that a \"0\" value could have come from an error in the sensor.\n",
+    "Looks good! But wait---there also appear to be some values in the array that are not physically possible! We know for sure that there was nothing cold in the greenhouse during the measurements; also it's very likely that a \"0\" value could have come from an error in the sensor.\n",
     "\n",
     "See if you can apply the `numpy` method `nonzero` to remove zeros from the array. Hint: it works in a very similar way to `isnan`, which we used above."
    ]
@@ -433,8 +433,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "distance = YOUR_CODE_HERE #distance[np.nonzero(temperature)]\n",
-    "temperature = YOUR_CODE_HERE #temperature[np.nonzero(temperature)]"
+    "distance = YOUR_CODE_HERE\n",
+    "temperature = YOUR_CODE_HERE"
    ]
   },
   {
@@ -465,8 +465,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "YOUR_CODE_HERE #distance = distance[temperature < 50]\n",
-    "YOUR_CODE_HERE #temperature = temperature[temperature < 50]"
+    "YOUR_CODE_HERE\n",
+    "YOUR_CODE_HERE"
    ]
   },
   {
@@ -484,10 +484,10 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "plt.plot(distance, temperature, \"ok\", label=\"Temperature\")\n",
+    "plt.plot(distance, temperature, \"ok\", label = 'Temperature')\n",
     "plt.title(\"Super duper greenhouse\")\n",
-    "plt.xlabel(\"Distance\")\n",
-    "plt.ylabel(\"Temperature\")\n",
+    "plt.xlabel('Distance')\n",
+    "plt.ylabel('Temperature')\n",
     "plt.show()"
    ]
   },
@@ -496,7 +496,7 @@
    "id": "30bce92b",
    "metadata": {},
    "source": [
-    "Let's pretend that there is a systematic error in our measurement device because it was not calibrated properly. As a result, all observations below 15 degrees need to be corrected by multiplying the measurement by 1.5. Numpy actually makes it very easy to replace the contents of an array based on a condition using the `where` method!"
+    "Let's pretend there is a systematic error in our measurement device because it was not properly calibrated. It causes all observations below 15 degrees need to be corrected dividing the multiplying the measurement by 1.5. Numpy actually makes it very easy to change the contents of an array conditionally by replacement using the `where` method!"
    ]
   },
   {
@@ -507,7 +507,7 @@
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
     "<p>\n",
     "<b>Task 2.5:</b>   \n",
-    "    Play with the cell below to understand what the <code>where</code> method does (i.e., replacement)—it's very useful to know about!\n",
+    "    Play with the cell below to understand what the <code>where</code> method does (i.e., replacement)---it's very useful to know about!\n",
     "</p>\n",
     "</div>"
    ]
@@ -519,7 +519,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "temperature = np.where(temperature > 15, temperature, temperature * 1.5)"
+    "temperature = np.where(temperature>15, temperature, temperature*1.5)"
    ]
   },
   {
@@ -539,10 +539,10 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "plt.plot(distance, temperature, \"ok\", label=\"Temperature\")\n",
+    "plt.plot(distance, temperature, \"ok\", label = 'Temperature')\n",
     "plt.title(\"Super duper greenhouse\")\n",
-    "plt.xlabel(\"Distance\")\n",
-    "plt.ylabel(\"Temperature\")\n",
+    "plt.xlabel('Distance')\n",
+    "plt.ylabel('Temperature')\n",
     "plt.show()"
    ]
   },
@@ -574,13 +574,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "YOUR_CODE_HERE\n",
-    "\n",
-    "# mean_temperature = temperature.mean()\n",
-    "# print(f\"{mean_temperature = :.3f}\")\n",
-    "# \n",
-    "# variance_temperature = temperature.var()\n",
-    "# print(f\"{variance_temperature = :.3f}\")"
+    "YOUR_CODE_HERE"
    ]
   },
   {
@@ -596,7 +590,7 @@
    "id": "2df59bce",
    "metadata": {},
    "source": [
-    "Have you ever gotten frustrated by sharing code with your friends? How nice would it be to do it the Google-Docs style and work on the same document simultaneously! Maybe you know Deepnote, which does this in an online interface. But there's a better solution: [Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/)!\n",
+    "Did you ever got frustrated by sharing code with your friends? How nice would it be to do it the Google-Docs style and work on the same document simultaneously! Maybe you know Deepnote, which does this in an online interface. But there's a better solution: [Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/)!\n",
     "\n",
     "In this PA you'll install the required extension in VS Code. You'll use this extension on Wednesday in class, and can freely use it in your future career!"
    ]
@@ -609,7 +603,7 @@
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
     "<p>\n",
     "<b>Task 3.1:</b>   \n",
-    "    Download, install and login in the Visual Studio Live Share Extension from the Visual Studio Marketplace as explained in the <a href=\"https://mude.citg.tudelft.nl/2024/book/external/learn-programming/book/install/ide/vsc/vs_live_share.html\">book</a>.\n",
+    "    Download, install and login in the Visual Studio Live Share Extension from the Visual Studio Marketplace as explained in the <a href=\"https://mude.citg.tudelft.nl/2024/book/external/learn-programming/book/install/ide/vsc/vs_live_share.html\">book</a>\n",
     "</p>\n",
     "</div>"
    ]
@@ -619,7 +613,7 @@
    "id": "2751b89a",
    "metadata": {},
    "source": [
-    "After installing and signing into Visual Studio Live Share, you'll share a project with yourself to test the collaboration session."
+    "After installing and signing into Visual Studio Live Share, you'll share a project with yourself to test the collaboration session"
    ]
   },
   {
@@ -630,7 +624,7 @@
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
     "<p>\n",
     "<b>Task 3.2:</b>   \n",
-    "    Use your normal workflow to open the folder where this notebook is situated in VS Code.\n",
+    "    Use your normal workflow to open a folder\n",
     "</p>\n",
     "</div>"
    ]
@@ -654,17 +648,17 @@
   },
   {
    "cell_type": "markdown",
-   "id": "d3913dbd",
+   "id": "bffc6617",
    "metadata": {},
    "source": [
-    "An invitation link will be automatically copied to your clipboard. You'll use this link to interact with yourself in this assignment. If you want to collaborate with others, you can share this link with them to open up the project in their browser or own VS Code.\n",
+    "An invitation link will be automatically copied to your clipboard. You'll use this link to interact with yourself in this assignment. If you want to collaborate with other, you can share this link with other to open up the project in their browser on own VS Code.\n",
     "\n",
     "You'll also see the **Live Share** status bar item change to represent the session state."
    ]
   },
   {
    "cell_type": "markdown",
-   "id": "733f5991",
+   "id": "1b1316a8",
    "metadata": {},
    "source": [
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
@@ -677,7 +671,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "47829808",
+   "id": "7d16af72",
    "metadata": {},
    "source": [
     "A web version of Visual Studio Code will open in your browser. Continue there."
@@ -685,7 +679,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "b29c3e15",
+   "id": "f64ec5b2",
    "metadata": {},
    "source": [
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
@@ -698,7 +692,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "4c76259c",
+   "id": "2e629aaa",
    "metadata": {},
    "source": [
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
@@ -712,7 +706,7 @@
   {
    "cell_type": "code",
    "execution_count": null,
-   "id": "84ee5ab9",
+   "id": "7a2647f4",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -721,20 +715,20 @@
   },
   {
    "cell_type": "markdown",
-   "id": "784d01d1",
+   "id": "5218a751",
    "metadata": {},
    "source": [
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
     "<p>\n",
     "<b>Task 3.7:</b>   \n",
-    "    Go back to your browser version of VS code and try running the cell. Note that this requires the browser participant to request access. Request that access and approve it in the desktop participant of VS code. In the desktop participant you now need to select your Python environment. Does the cell run? Do you see the output in both participants? Make sure the output doesn't show an error!\n",
+    "    Go back to your browser version of VS code and try running the cell. Note that this requires Requesting access in the browser participant. Request that access and approve it in the desktop participant of VS code. In the desktop participant you now need to select your python environment. Does the cell run? Do you see the output in both participants? Make sure the output doesn't show an error!\n",
     "</p>\n",
     "</div>"
    ]
   },
   {
    "cell_type": "markdown",
-   "id": "07911996",
+   "id": "05c2b97a",
    "metadata": {},
    "source": [
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
@@ -748,7 +742,7 @@
   {
    "cell_type": "code",
    "execution_count": null,
-   "id": "3c8723e3",
+   "id": "a9b9f24b",
    "metadata": {},
    "outputs": [],
    "source": [
@@ -758,7 +752,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "b38e7f33",
+   "id": "55b401c9",
    "metadata": {},
    "source": [
     "That's cool right? Imagine what you could do with this..."
@@ -766,7 +760,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "f85acf2e",
+   "id": "4b332269",
    "metadata": {},
    "source": [
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
@@ -779,7 +773,7 @@
   },
   {
    "cell_type": "markdown",
-   "id": "61f4088d",
+   "id": "dd8361f4",
    "metadata": {},
    "source": [
     "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
@@ -789,10 +783,7 @@
     "</p>\n",
     "<img src=\"https://learn.microsoft.com/en-us/visualstudio/liveshare/media/vscode-end-collaboration-viewlet.png\">\n",
     "<p>\n",
-    "Don't forget to save your work! You could have done that both on the browser-participant as on the desktop-participant!\n",
-    "</p>\n",
-    "<p>\n",
-    "After stopping the collaboration session, your web-participant will be notified that the session is over. It won't be able to access the content and any temp files will automatically be cleaned up.\n",
+    "Your web-participant will be notified that the session is over. It won't be able to access the content and any temp files will automatically be cleaned up. Don't forget to save your work on the desktop-participant!\n",
     "</p>\n",
     "</div>"
    ]
diff --git a/content/week_1_3/PA_1_3_solution.ipynb b/content/week_1_3/PA_1_3_solution.ipynb
new file mode 100644
index 00000000..1d1b1f32
--- /dev/null
+++ b/content/week_1_3/PA_1_3_solution.ipynb
@@ -0,0 +1,852 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "d14e9d93",
+   "metadata": {},
+   "source": [
+    "# PA 1.3: Data Cleaning and Boosting Productivity\n",
+    "\n",
+    "<h1 style=\"position: absolute; display: flex; flex-grow: 0; flex-shrink: 0; flex-direction: row-reverse; top: 60px;right: 30px; margin: 0; border: 0\">\n",
+    "    <style>\n",
+    "        .markdown {width:100%; position: relative}\n",
+    "        article { position: relative }\n",
+    "    </style>\n",
+    "    <img src=\"https://gitlab.tudelft.nl/mude/public/-/raw/main/tu-logo/TU_P1_full-color.png\" style=\"width:100px; height: auto; margin: 0\" />\n",
+    "    <img src=\"https://gitlab.tudelft.nl/mude/public/-/raw/main/mude-logo/MUDE_Logo-small.png\" style=\"width:100px; height: auto; margin: 0\" />\n",
+    "</h1>\n",
+    "<h2 style=\"height: 10px\">\n",
+    "</h2>\n",
+    "\n",
+    "*[CEGM1000 MUDE](http://mude.citg.tudelft.nl/): Week 1.3. Due: before Friday, Sep 20, 2023.*"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "f5a4caf7",
+   "metadata": {},
+   "source": [
+    "This PA consists of two parts:\n",
+    " - Data Cleaning, with task 1.1 - 2.6\n",
+    " - Boosting Productivity, with task ..."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "0b0a42bb",
+   "metadata": {},
+   "source": [
+    "## Data cleaning\n",
+    "\n",
+    "Often we get data in a file that contains unexpected and odd things inside. If not removed in a proper way, they can cause problems in our analysis. For example, NaNs, infinite values, or just really large outliers may cause things in our code to behave in an unexpected way. It is good practice to **get in the habit of visualizing and processing datasets before you start using them!** This programming assignment will illustrate this process.\n",
+    "\n",
+    "Topics in this assignment includes two tasks: \n",
+    "1. Finding \"odd\" values in an array and removing them\n",
+    "2. Using plots to identify other \"oddities\" that can be removed\n",
+    "\n",
+    "We will need one csv file, `data_2.csv`, to complete this assignment."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "846ae254",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# use the mude-base environment\n",
+    "\n",
+    "import numpy as np\n",
+    "import matplotlib.pyplot as plt"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "78611f77",
+   "metadata": {},
+   "source": [
+    "### Task 1: Importing and Cleaning the array\n",
+    "\n",
+    "In a previous week we looked at how to read in data from a csv, plot a nice graph and even find the $R^2$ of the data. This week an eager botany student, Johnathan, has asked us to help him analyze some data: 1000 measurements have just been completed over the 100m of greenhouse and are ready to use in `data_2.csv`. Johnathan happens to have a lot of free time but not that much experience taking measurements. Thus, there is some noise in the data and some problematic data that are a result of an error in the measurement device. Let's help them out!"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "431f871f",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 1.1:</b>   \n",
+    "Import the data as 2 numpy arrays: distance and temperature.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "05110070",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "distance, temperature = np.genfromtxt(\"data_2.csv\", skip_header = 1, delimiter=\",\", unpack=True)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "006eea78",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 1.2:</b>   \n",
+    "In the code cell below, evaluate the size of the array.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "6b4ca75e",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "temperature.size"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "fde15a07",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 1.3:</b>   \n",
+    " Check by defining a variable <code>boolean</code> using the numpy method <code>isnan</code>, which returns a boolean vector (False if it is not a NaN, and True if it is a NaN). The code block below will also help you inspect the results.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "f830b4ad",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "boolean = np.isnan(temperature)\n",
+    "\n",
+    "print(\"The first 10 values are:\", boolean[0:10])\n",
+    "print(f\"There are {boolean.sum()} NaNs in array temperature\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "c9f8994b",
+   "metadata": {},
+   "source": [
+    "Let's slice the array using the `boolean` array we just found to eliminate the NaNs. We can use the symbol `~`, which denotes the opposite: we want to keep those where np.isnan gives False as an answer."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "6850cb15",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "temperature = temperature[~boolean]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "4882620e",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 1.4:</b>   \n",
+    "Check the size again, and make sure you recognize that we over-wrote the variable `temperature`. This will have an impact on other cells where you use this variable, for example, if you re-run the cell below Task 1.3, the result will be different, because the array contents have changed!\n",
+    "\n",
+    "How big is the array now? How many values were removed?\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "1a111476",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "temperature.size\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "94771b6e",
+   "metadata": {},
+   "source": [
+    "But now we have a problem: our `distance` array still has the entries that correspond to the bad entries in `temperature`. We can see that the dimensions of the arrays no longer match:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "ade77e1b",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "distance.size==temperature.size"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "8a80b2d6",
+   "metadata": {},
+   "source": [
+    "Also, we don't know what the index of the removed values were, since we over-wrote `temperature`! Luckily we have our `boolean` array, which records the indices with Nans, which we can also use to update our `distance` array."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "7b1fac3b",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 1.5:</b>   \n",
+    "Use the boolean array from Task 1.3 to remove the matching entries in the distance array, then check that it has the same length as temperature.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "359c1f5a",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "distance = distance[~boolean]\n",
+    "distance.size==temperature.size"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "3c494a0b",
+   "metadata": {},
+   "source": [
+    "### Task 2: Visualizing the Dataset\n",
+    "\n",
+    "Now we can plot the temperature with distance to see what it looks like."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "3ea30aa1",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "plt.plot(distance, temperature, \"ok\", label = 'Temperature')\n",
+    "plt.title(\"Super duper greenhouse\")\n",
+    "plt.xlabel('Distance')\n",
+    "plt.ylabel('Temperature')\n",
+    "plt.show()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "a90e8b18",
+   "metadata": {},
+   "source": [
+    "It looks like there are some outliers in the dataset still! Let's investigate:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "e05bdc36",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "print(temperature.min())\n",
+    "print(temperature.max())"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "9e8d396a",
+   "metadata": {},
+   "source": [
+    "The values are suspcious since they are +/-999...this is a common error code with some sensors, so we can assume that they can be removed from the dataset. We can easily remove these erroneous values of temperature, but this time we will use a different method than before. The explamation mark before an equals sig, `!=`, denotes \"not equal to.\" We can use this as a logic operator to directly eliminate the values in one line. For example:\n",
+    "```\n",
+    "array_1 = array_1[array_2!=-999]\n",
+    "```"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "33755648",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 2.1:</b>   \n",
+    "Use the \"not equal to\" operator to re-define temperature and distance such that all the temperatures with -999 are removed (don't do the +999 values yet!). Keep in mind that the order of the arrays matters: if you reassign temperature, you won't have the information any more to fix distance!!!\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "760ef4fc",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "distance = distance[temperature!=-999]\n",
+    "temperature = temperature[temperature!=-999]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "62f66295",
+   "metadata": {},
+   "source": [
+    "Are the arrays the same size still? If you did it correctly, they should be."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "c2565d1a",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "print(distance.size==temperature.size)\n",
+    "temperature.size"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "7387ef6e",
+   "metadata": {},
+   "source": [
+    "For the +999 values we will use yet another method, a combination of the previous two."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "5c92b030",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 2.2:</b>   \n",
+    "    Use the not equal to operator <b>and</b> a boolean array to define an array \"mask\" that will help you remove the data corresponding to temperatures with +999.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "b5aa308b",
+   "metadata": {},
+   "source": [
+    "We can also do it with a boolean for data_y."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "87c3df95",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "mask = temperature!=999\n",
+    "distance = distance[mask]\n",
+    "temperature = temperature[mask]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "830e00fd",
+   "metadata": {},
+   "source": [
+    "The array is names \"mask\" because this process utilizes **masked arrays**...you can read more about it [here](https://python.plainenglish.io/numpy-masks-in-python-d8c13509fbc8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "aaf6c255",
+   "metadata": {},
+   "source": [
+    "Anyway, now that we have removed the annoying +/-999 values, we can finally start to see our dataset more clearly:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "c4d68786",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "plt.plot(distance, temperature, \"ok\", label = 'Temperature')\n",
+    "plt.title(\"Super duper greenhouse\")\n",
+    "plt.xlabel('Distance')\n",
+    "plt.ylabel('Temperature')\n",
+    "plt.show()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "999da984",
+   "metadata": {},
+   "source": [
+    "Looks good! But wait---there also appear to be some values in the array that are not physically possible! We know for sure that there was nothing cold in the greenhouse during the measurements; also it's very likely that a \"0\" value could have come from an error in the sensor.\n",
+    "\n",
+    "See if you can apply the `numpy` method `nonzero` to remove zeros from the array. Hint: it works in a very similar way to `isnan`, which we used above."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "e0c74257",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 2.3:</b>   \n",
+    "    Use <code>nonzero</code> to remove the zeros.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "20c58ef0",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "distance = distance[np.nonzero(temperature)]\n",
+    "temperature = temperature[np.nonzero(temperature)]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "f6ccca34",
+   "metadata": {},
+   "source": [
+    "It also seems quite obvious that the values above 50 degrees are also not physically possible (or perhaps Jonathan was standing near an oven?!). In any case, they aren't consistent with the rest of the data, so we should remove them."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "ccb300c2",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 2.4:</b>   \n",
+    "    Use an inequality, <code><</code> to keep all values less than 50.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "faa439a0",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "distance = distance[temperature<50]\n",
+    "temperature = temperature[temperature<50]"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "cf41837a",
+   "metadata": {},
+   "source": [
+    "Now let's take another look at our data:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "2bcbdda1",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "plt.plot(distance, temperature, \"ok\", label = 'Temperature')\n",
+    "plt.title(\"Super duper greenhouse\")\n",
+    "plt.xlabel('Distance')\n",
+    "plt.ylabel('Temperature')\n",
+    "plt.show()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "30bce92b",
+   "metadata": {},
+   "source": [
+    "Let's pretend there is a systematic error in our measurement device because it was not properly calibrated. It causes all observations below 15 degrees need to be corrected dividing the multiplying the measurement by 1.5. Numpy actually makes it very easy to change the contents of an array conditionally by replacement using the `where` method!"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "81061b72",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 2.5:</b>   \n",
+    "    Play with the cell below to understand what the <code>where</code> method does (i.e., replacement)---it's very useful to know about!\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "4a20fc63",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "temperature = np.where(temperature>15, temperature, temperature*1.5)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "2169cd1a",
+   "metadata": {},
+   "source": [
+    "Remember you can investigate the `where` function in a notebook easily by executing `np.where?`. Try it and read the documentation!\n",
+    "\n",
+    "Let's plot the array again to see what happened (you'll have to compare the two plots carefully to see the difference). Remember, that if you rerun the cell above many times, it will over-write `temperature`, so you will probably need to restart the kernel a few times to reset the values."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "e650f1d3",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "plt.plot(distance, temperature, \"ok\", label = 'Temperature')\n",
+    "plt.title(\"Super duper greenhouse\")\n",
+    "plt.xlabel('Distance')\n",
+    "plt.ylabel('Temperature')\n",
+    "plt.show()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "8446e2c6",
+   "metadata": {},
+   "source": [
+    "Now that we are done cleaning the data, let's learn about it. "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "27cf2d39",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 2.6:</b>   \n",
+    "    Calculate the mean and variance of temperature. Use built-in numpy functions.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "c833c8fd",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "mean_temperature = temperature.mean()\n",
+    "print(f\"{mean_temperature = :.3f}\")\n",
+    "\n",
+    "variance_temperature = temperature.var()\n",
+    "print(f\"{variance_temperature = :.3f}\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "ba022766",
+   "metadata": {},
+   "source": [
+    "## Boosting productivity"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "2df59bce",
+   "metadata": {},
+   "source": [
+    "Did you ever got frustrated by sharing code with your friends? How nice would it be to do it the Google-Docs style and work on the same document simultaneously! Maybe you know Deepnote, which does this in an online interface. But there's a better solution: [Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/)!\n",
+    "\n",
+    "In this PA you'll install the required extension in VS Code. You'll use this extension on Wednesday in class, and can freely use it in your future career!"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "ebc784c9",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.1:</b>   \n",
+    "    Download, install and login in the Visual Studio Live Share Extension from the Visual Studio Marketplace as explained in the <a href=\"https://mude.citg.tudelft.nl/2024/book/external/learn-programming/book/install/ide/vsc/vs_live_share.html\">book</a>\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "2751b89a",
+   "metadata": {},
+   "source": [
+    "After installing and signing into Visual Studio Live Share, you'll share a project with yourself to test the collaboration session"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "3b0f7167",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.2:</b>   \n",
+    "    Use your normal workflow to open a folder\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "dadc8b67",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.3:</b>   \n",
+    "    Start a collaboration session: select <strong>Live Share</strong> on the status bar or select <strong>Ctrl+Shift+P</strong> or <strong>Cmd+Shift+P</strong> and then select <strong>Live Share: Start collaboration session (Share)</strong>.\n",
+    "</p>\n",
+    "<img src=\"https://learn.microsoft.com/en-us/visualstudio/liveshare/media/install-live-share-visual-studio-code/live-share-button-status-bar.png\" alt=\"Live Share Button\">\n",
+    "<p>\n",
+    "The first time you share, your desktop firewall software might prompt you to allow the Live Share agent to open a port. Opening a port is optional. It enables a secured direct mode to improve performance when the person you're working with is on the same network as you. For more information, see <a href=\"https://learn.microsoft.com/en-us/visualstudio/liveshare/reference/connectivity#changing-the-connection-mode\">changing the connection mode</a>.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "bffc6617",
+   "metadata": {},
+   "source": [
+    "An invitation link will be automatically copied to your clipboard. You'll use this link to interact with yourself in this assignment. If you want to collaborate with other, you can share this link with other to open up the project in their browser on own VS Code.\n",
+    "\n",
+    "You'll also see the **Live Share** status bar item change to represent the session state."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "1b1316a8",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.4:</b>   \n",
+    "    Copy the invitation link in your web browser.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "7d16af72",
+   "metadata": {},
+   "source": [
+    "A web version of Visual Studio Code will open in your browser. Continue there."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "f64ec5b2",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.5:</b>   \n",
+    "    Login using the same steps as in task 3.2.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "2e629aaa",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.6:</b>   \n",
+    "    Go back to your desktop participant of VS code and try typing a few lines of correct code in the cell below. Do you see the same change in the browser happening live?\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "7a2647f4",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "print('hello world')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "5218a751",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.7:</b>   \n",
+    "    Go back to your browser version of VS code and try running the cell. Note that this requires Requesting access in the browser participant. Request that access and approve it in the desktop participant of VS code. In the desktop participant you now need to select your python environment. Does the cell run? Do you see the output in both participants? Make sure the output doesn't show an error!\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "05c2b97a",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.8:</b>   \n",
+    "    Let's try to make sense of what's happening. Where is the code executed? Run the following code cell from the browser participant. On which computer does this collaborative session run?\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "a9b9f24b",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import platform\n",
+    "print(\"Running on a\", platform.system(),\"machine named:\", platform.node())"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "55b401c9",
+   "metadata": {},
+   "source": [
+    "That's cool right? Imagine what you could do with this..."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "4b332269",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.9:</b>   \n",
+    "    Explore some of the functionalities of the Live Share (session chat, following). More information can be found <a href=\"https://learn.microsoft.com/en-us/visualstudio/liveshare/\">here</a>.\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "dd8361f4",
+   "metadata": {},
+   "source": [
+    "<div style=\"background-color:#AABAB2; color: black; vertical-align: middle; padding:15px; margin: 10px; border-radius: 10px\">\n",
+    "<p>\n",
+    "<b>Task 3.10:</b>   \n",
+    "    Stop the collaboration session on the desktop-participant by opening the Live Share view on the <strong>Explorer</strong> tab or the <strong>VS Live Share tab</strong> and select the <strong>Stop collaboration session</strong> button:\n",
+    "</p>\n",
+    "<img src=\"https://learn.microsoft.com/en-us/visualstudio/liveshare/media/vscode-end-collaboration-viewlet.png\">\n",
+    "<p>\n",
+    "Your web-participant will be notified that the session is over. It won't be able to access the content and any temp files will automatically be cleaned up. Don't forget to save your work on the desktop-participant!\n",
+    "</p>\n",
+    "</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "d191fa12",
+   "metadata": {},
+   "source": [
+    "**End of notebook.**\n",
+    "<h2 style=\"height: 60px\">\n",
+    "</h2>\n",
+    "<h3 style=\"position: absolute; display: flex; flex-grow: 0; flex-shrink: 0; flex-direction: row-reverse; bottom: 60px; right: 50px; margin: 0; border: 0\">\n",
+    "    <style>\n",
+    "        .markdown {width:100%; position: relative}\n",
+    "        article { position: relative }\n",
+    "    </style>\n",
+    "    <a rel=\"license\" href=\"http://creativecommons.org/licenses/by/4.0/\">\n",
+    "      <img alt=\"Creative Commons License\" style=\"border-width:; width:88px; height:auto; padding-top:10px\" src=\"https://i.creativecommons.org/l/by/4.0/88x31.png\" />\n",
+    "    </a>\n",
+    "    <a rel=\"TU Delft\" href=\"https://www.tudelft.nl/en/ceg\">\n",
+    "      <img alt=\"TU Delft\" style=\"border-width:0; width:100px; height:auto; padding-bottom:0px\" src=\"https://gitlab.tudelft.nl/mude/public/-/raw/main/tu-logo/TU_P1_full-color.png\" />\n",
+    "    </a>\n",
+    "    <a rel=\"MUDE\" href=\"http://mude.citg.tudelft.nl/\">\n",
+    "      <img alt=\"MUDE\" style=\"border-width:0; width:100px; height:auto; padding-bottom:0px\" src=\"https://gitlab.tudelft.nl/mude/public/-/raw/main/mude-logo/MUDE_Logo-small.png\" />\n",
+    "    </a>\n",
+    "    \n",
+    "</h3>\n",
+    "<span style=\"font-size: 75%\">\n",
+    "&copy; Copyright 2024 <a rel=\"MUDE\" href=\"http://mude.citg.tudelft.nl/\">MUDE</a> TU Delft. This work is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by/4.0/\">CC BY 4.0 License</a>."
+   ]
+  }
+ ],
+ "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.12.4"
+  },
+  "widgets": {
+   "application/vnd.jupyter.widget-state+json": {
+    "state": {},
+    "version_major": 2,
+    "version_minor": 0
+   }
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/content/week_1_3/data_2.csv b/content/week_1_3/auxiliary_files/data_2.csv
similarity index 100%
rename from content/week_1_3/data_2.csv
rename to content/week_1_3/auxiliary_files/data_2.csv
-- 
GitLab