Skip to content

Commit 39a381d

Browse files
authored
Fix CSV reading and problem detection logic
Updated the code to read the entire CSV file into a variable and improved the function for detecting problems.
1 parent be36445 commit 39a381d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

02_activities/assignments/assignment_2.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
"with open(all_paths[0], 'r') as f:\n",
9797
" # YOUR CODE HERE: Use the readline() or readlines() method to read the .csv file into a variable\n",
9898
" \n",
99-
" dataset = f.readlines()\n", # reads only first item inflammation_01.csv
99+
" dataset = f.readlines(),
100+
" # reads only first item inflammation_01.csv
100101
" # YOUR CODE HERE: Iterate through the variable using a for loop and print each row for inspection"
101102
" for x in dataset:\n",
102103
" print(x)"
@@ -269,8 +270,6 @@
269270
" #YOUR CODE HERE: Use patient_summary() to get the means and check_zeros() to check for zeros in the means\n",
270271
" mean_data = patient_summary(file_path, 'mean')\n",
271272
" result = check_zeros(mean_data)\n",
272-
" if result:\n",
273-
" print(f\"check zero returned {result}, i.e average (mean) inflammation score of 0"),
274273
" return result"
275274
"\n",
276275
" return"

0 commit comments

Comments
 (0)