Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions 02_activities/assignments/assignment_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"id": "82-bk4CBB1w4"
},
Expand All @@ -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",
Expand Down Expand Up @@ -231,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"id": "_svDiRkdIwiT"
},
Expand All @@ -254,7 +257,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"id": "LEYPM5v4JT0i"
},
Expand All @@ -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",
Expand Down