Skip to content

Commit 7a5087e

Browse files
committed
please refer to this version of the assigment
1 parent 3938687 commit 7a5087e

1 file changed

Lines changed: 28 additions & 24 deletions

File tree

‎02_activities/assignments/assignment_2.ipynb‎

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
{
7474
"cell_type": "code",
75-
"execution_count": 3,
75+
"execution_count": 48,
7676
"metadata": {
7777
"id": "n0m48JsS-nMC"
7878
},
@@ -224,15 +224,17 @@
224224
"with open(all_paths[0], 'r') as f:\n",
225225
" \n",
226226
" # YOUR CODE HERE: Use the readline() or readlines() method to read the .csv file into a variable\n",
227-
" print (f.readlines ()) \n",
228-
"# I open the file 01.csv as a list\n",
227+
" print (f.readlines ())\n",
228+
" \n",
229+
" \n",
230+
"# I opened the file 01.csv into a variabe [as a list]\n",
229231
" \n",
230232
" \n",
231233
" # YOUR CODE HERE: Iterate through the variable using a for loop and print each row for inspection\n",
232234
"with open(all_paths[0], 'r') as f:\n",
233235
" for i in range (60):\n",
234236
" print(f. readline())\n",
235-
"# I opened each line fo inspection "
237+
"# I opened each line for inspection using a for loop"
236238
]
237239
},
238240
{
@@ -266,7 +268,7 @@
266268
},
267269
{
268270
"cell_type": "code",
269-
"execution_count": 43,
271+
"execution_count": 49,
270272
"metadata": {
271273
"id": "82-bk4CBB1w4"
272274
},
@@ -297,12 +299,14 @@
297299
" # If the operation is not one of the expected values, raise an error\n",
298300
" raise ValueError(\"Invalid operation. Please choose 'mean', 'max', or 'min'.\")\n",
299301
"\n",
300-
" return summary_values\n"
302+
" return summary_values\n",
303+
"# explanation: based on the structure you provided and the lectures I defined the variable \"summary_values\" as the outcome of using one of the methods \n",
304+
"# (min, max, mean) on the array \"data\", while ax defined as 1 [row]"
301305
]
302306
},
303307
{
304308
"cell_type": "code",
305-
"execution_count": 44,
309+
"execution_count": 50,
306310
"metadata": {},
307311
"outputs": [
308312
{
@@ -322,7 +326,7 @@
322326
},
323327
{
324328
"cell_type": "code",
325-
"execution_count": null,
329+
"execution_count": 51,
326330
"metadata": {},
327331
"outputs": [
328332
{
@@ -337,7 +341,7 @@
337341
" 6.725, 5.7 , 6.25 , 6.4 , 7.05 , 5.9 ])"
338342
]
339343
},
340-
"execution_count": 29,
344+
"execution_count": 51,
341345
"metadata": {},
342346
"output_type": "execute_result"
343347
}
@@ -349,7 +353,7 @@
349353
},
350354
{
351355
"cell_type": "code",
352-
"execution_count": 30,
356+
"execution_count": 52,
353357
"metadata": {},
354358
"outputs": [
355359
{
@@ -361,7 +365,7 @@
361365
" 0., 0., 0., 0., 0., 0., 0., 0., 0.])"
362366
]
363367
},
364-
"execution_count": 30,
368+
"execution_count": 52,
365369
"metadata": {},
366370
"output_type": "execute_result"
367371
}
@@ -372,7 +376,7 @@
372376
},
373377
{
374378
"cell_type": "code",
375-
"execution_count": 31,
379+
"execution_count": 53,
376380
"metadata": {},
377381
"outputs": [
378382
{
@@ -385,7 +389,7 @@
385389
" 17., 15., 17., 16., 17., 19., 18., 18.])"
386390
]
387391
},
388-
"execution_count": 31,
392+
"execution_count": 53,
389393
"metadata": {},
390394
"output_type": "execute_result"
391395
}
@@ -396,7 +400,7 @@
396400
},
397401
{
398402
"cell_type": "code",
399-
"execution_count": 46,
403+
"execution_count": 54,
400404
"metadata": {
401405
"id": "3TYo0-1SDLrd"
402406
},
@@ -421,14 +425,14 @@
421425
" [17., 19., 18., 18.]])"
422426
]
423427
},
424-
"execution_count": 46,
428+
"execution_count": 54,
425429
"metadata": {},
426430
"output_type": "execute_result"
427431
}
428432
],
429433
"source": [
430434
"patient_summary (all_paths[0], 'max').reshape (15,4)\n",
431-
"# here I used a method of array data type to organize the max matrix\n"
435+
"# here I used an array data type's method [reshape] to organize the max matrix\n"
432436
]
433437
},
434438
{
@@ -486,7 +490,7 @@
486490
},
487491
{
488492
"cell_type": "code",
489-
"execution_count": 33,
493+
"execution_count": 55,
490494
"metadata": {
491495
"id": "_svDiRkdIwiT"
492496
},
@@ -509,7 +513,7 @@
509513
},
510514
{
511515
"cell_type": "code",
512-
"execution_count": null,
516+
"execution_count": 56,
513517
"metadata": {
514518
"id": "LEYPM5v4JT0i"
515519
},
@@ -526,13 +530,13 @@
526530
" else:\n",
527531
" return False\n",
528532
" \n",
529-
" # explanation: I defined x in the same way data_mean was defined. Then, based on your explanation tath the check_zeros\n",
530-
" # function returns only boolean values, I defined the conditional."
533+
" # explanation: I defined x in the same way \"data_mean\" was defined above. Then, based on the explanation you provided on the check_zeros\n",
534+
" # function which returns only boolean values, I defined the conditional."
531535
]
532536
},
533537
{
534538
"cell_type": "code",
535-
"execution_count": 40,
539+
"execution_count": 57,
536540
"metadata": {},
537541
"outputs": [
538542
{
@@ -551,7 +555,7 @@
551555
},
552556
{
553557
"cell_type": "code",
554-
"execution_count": null,
558+
"execution_count": 58,
555559
"metadata": {},
556560
"outputs": [
557561
{
@@ -565,12 +569,12 @@
565569
"source": [
566570
"print(detect_problems(all_paths[1]))\n",
567571
"\n",
568-
"## here I changed the all the values in row 60 in \"_02.csv\" to 0, and then test this file to chec my function"
572+
"## here I changed all the values in row 60 in \"_02.csv\" to 0, and then test this file to check my function"
569573
]
570574
},
571575
{
572576
"cell_type": "code",
573-
"execution_count": 42,
577+
"execution_count": 59,
574578
"metadata": {},
575579
"outputs": [
576580
{

0 commit comments

Comments
 (0)