From 08bc4bf52f53cb21e6fd02ca351f35a784dbf38b Mon Sep 17 00:00:00 2001 From: chude onyeibo Date: Mon, 15 Dec 2025 00:48:51 +0100 Subject: [PATCH] Anthony assignment --- 02_activities/assignments/assignment_2.ipynb | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/02_activities/assignments/assignment_2.ipynb b/02_activities/assignments/assignment_2.ipynb index aa14ce03..36ad96fa 100644 --- a/02_activities/assignments/assignment_2.ipynb +++ b/02_activities/assignments/assignment_2.ipynb @@ -133,7 +133,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "id": "82-bk4CBB1w4" }, @@ -149,12 +149,15 @@ " if operation == 'mean':\n", " # YOUR CODE HERE: Calculate the mean (average) number of flare-ups for each patient\n", " summary_values = np.mean(data, axis=ax)\n", + "\n", " elif operation == 'max':\n", " # YOUR CODE HERE: Calculate the maximum number of flare-ups experienced by each patient\n", " summary_values = np.max(data, axis=ax)\n", + "\n", " elif operation == 'min':\n", " # YOUR CODE HERE: Calculate the minimum number of flare-ups experienced by each patient\n", " summary_values = np.min(data, axis=ax)\n", + "\n", " else:\n", " # If the operation is not one of the expected values, raise an error\n", " raise ValueError(\"Invalid operation. Please choose 'mean', 'max', or 'min'.\")\n", @@ -231,7 +234,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "id": "_svDiRkdIwiT" }, @@ -254,7 +257,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": { "id": "LEYPM5v4JT0i" }, @@ -264,23 +267,20 @@ "\n", "def detect_problems(file_path):\n", " #YOUR CODE HERE: Use patient_summary() to get the means and check_zeros() to check for zeros in the means\n", + " # Get the mean inflammation scores for all patients\n", + " means = patient_summary(file_path, 'mean')\n", + " \n", + " # Check if there are any zero values in the means\n", + " has_zeros = check_zeros(means)\n", "\n", - " return" + " return has_zeros" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "None\n" - ] - } - ], + "outputs": [], "source": [ "# Test out your code here\n", "# Your output for the first file should be False\n",