From bd55bc96b9a34bbfb2e39b99220e1309fced089e Mon Sep 17 00:00:00 2001 From: ytynicole Date: Sat, 6 Dec 2025 22:45:43 -0500 Subject: [PATCH 1/2] Update assignment_2.ipynb --- 02_activities/assignments/assignment_2.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment_2.ipynb b/02_activities/assignments/assignment_2.ipynb index fdaead28..66b9a3b0 100644 --- a/02_activities/assignments/assignment_2.ipynb +++ b/02_activities/assignments/assignment_2.ipynb @@ -95,6 +95,9 @@ "\n", "with open(all_paths[0], 'r') as f:\n", " # YOUR CODE HERE: Use the readline() or readlines() method to read the .csv file into a variable\n", + " lines = f.readlines()\n", + " for line in lines:\n", + " print(line)\n", " \n", " # YOUR CODE HERE: Iterate through the variable using a for loop and print each row for inspection" ] @@ -145,12 +148,15 @@ " # Implement the specific operation based on the 'operation' argument\n", " 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=1)\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=1)\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=1)\n", "\n", " else:\n", " # If the operation is not one of the expected values, raise an error\n", @@ -261,8 +267,9 @@ "\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", + "means = patient_summary(file_path, 'mean')\n", "\n", - " return" + " return check_zeros(means)" ] }, { From eee17428f11f7418b590212995191c6c20e25c40 Mon Sep 17 00:00:00 2001 From: ytynicole Date: Sat, 6 Dec 2025 22:46:42 -0500 Subject: [PATCH 2/2] Update assignment_2.ipynb --- 02_activities/assignments/assignment_2.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment_2.ipynb b/02_activities/assignments/assignment_2.ipynb index 66b9a3b0..560a85d6 100644 --- a/02_activities/assignments/assignment_2.ipynb +++ b/02_activities/assignments/assignment_2.ipynb @@ -267,7 +267,7 @@ "\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", - "means = patient_summary(file_path, 'mean')\n", + " means = patient_summary(file_path, 'mean')\n", "\n", " return check_zeros(means)" ]