|
95 | 95 | "\n", |
96 | 96 | "with open(all_paths[0], 'r') as f:\n", |
97 | 97 | " # YOUR CODE HERE: Use the readline() or readlines() method to read the .csv file into a variable\n", |
98 | | - " \n", |
99 | | - " dataset = f.readlines(), |
| 98 | + " dataset = f.readlines()\n" |
100 | 99 | " # reads only first item inflammation_01.csv |
101 | 100 | " # YOUR CODE HERE: Iterate through the variable using a for loop and print each row for inspection" |
102 | | - " for x in dataset:\n", |
| 101 | + " for row in dataset:\n", |
103 | 102 | " print(x)" |
104 | 103 | ] |
105 | 104 | }, |
|
150 | 149 | " if operation == 'mean':\n", |
151 | 150 | " # YOUR CODE HERE: Calculate the mean (average) number of flare-ups for each patient\n", |
152 | 151 | " summary_values = np.mean(data, axis=ax)\n", |
153 | | - "\n", |
154 | 152 | " elif operation == 'max':\n", |
155 | 153 | " # YOUR CODE HERE: Calculate the maximum number of flare-ups experienced by each patient\n", |
156 | 154 | " summary_values = np.max(data, axis=ax)\n", |
157 | | - "\n", |
158 | 155 | " elif operation == 'min':\n", |
159 | 156 | " # YOUR CODE HERE: Calculate the minimum number of flare-ups experienced by each patient\n", |
160 | 157 | " summary_values = np.min(data, axis=ax)\n", |
161 | | - "\n", |
162 | 158 | " else:\n", |
163 | 159 | " # If the operation is not one of the expected values, raise an error\n", |
164 | 160 | " raise ValueError(\"Invalid operation. Please choose 'mean', 'max', or 'min'.\")\n", |
|
271 | 267 | " mean_data = patient_summary(file_path, 'mean')\n", |
272 | 268 | " result = check_zeros(mean_data)\n", |
273 | 269 | " return result" |
274 | | - "\n", |
275 | | - " return" |
276 | 270 | ] |
277 | 271 | }, |
278 | 272 | { |
|
0 commit comments