Question: ONLY LIST STRUCTURE, WHILE, FOR LOOPS AND USER DEFINED FUNCTIONS MUST BE USED. IT IS AN PYTHON HOMEWORK. 01. A doctor has 10 patients suffering

ONLY LIST STRUCTURE, WHILE, FOR LOOPS AND USER DEFINED FUNCTIONS MUST BE USED. IT IS AN PYTHON HOMEWORK.

ONLY LIST STRUCTURE, WHILE, FOR LOOPS AND USER DEFINED FUNCTIONS MUST BE

01. A doctor has 10 patients suffering from thyroid diseases. She monitors their thyroid hormone levels (mU/L) on a daily basis. For the last week, she obtained the data below: Patient name William Laura Robert Alicia Sharon Jack Mary Edward Jessie Debra Monday 1.0 1.9 3.0 3.5 1.5 0.4 5.0 1.8 2.4 1.5 Tuesday 1.3 1.9 3.3 1.3 1.3 0.4 5.3 1.8 2.1 1.3 Wednesday 1.7 1.5 3.1 2.0 1.9 0.2 4.9 2.3 2.5 1.1 Days Thursday 1.1 1.8 2.7 2.4 1.0 0.5 5.5 1.8 2.9 Friday 1.8 1.9 3.5 3.7 1.2 0.6 5.2 1.8 3.1 1.3 Saturday 1.3 1.7 4.5 1.9 1.2 1.3 5.2 2.5 2.3 Sunday 1.2 1.5 4.7 2.0 1.1 2.4 4.8 2.4 2.9 1.2 2.1 1.3 To help her checking patients' test results, construct three lists: two one-dimensional lists for patient names and days as well as one two-dimensional list for hormone levels. While accessing the data, efficiently utilize these three lists via proper indexing. For instance, hormone_list[1][3] corresponds to Laura's (name_list[1]) hormone level on Thursday (day_list[3]). Keeping this in mind, write the shortest computer program (i.e. only one outer loop) that satisfies the following requirements: Normal range for thyroid hormone is 0.4 - 4.0 mU/L. For each patient, values lower than 0.4 and values higher than 4.0 (if any) should be temporarily stored in separate lists (i.e. days_high and days_low) and be printed to warn the doctor. Print this information using list comprehension structures. Calculate the weekly average for each patient without using sum function. If this average is outside the normal range, doctor should be warned. Calculate weekly standard deviation for each patient using the following equation: 21(xi - x)2 SD = n-1 where n is the number of data points, Xi is a data point, and x is the average of data points. Again, sum function is not allowed. If standard deviation is greater than 0.5, doctor should be warned. Your output should look like the following: WARNING: High values for Robert: Saturday Sunday WARNING: High standard deviation for Robert WARNING: High standard deviation for Alicia WARNING: Low values for Jack: Wednesday WARNING: High standard deviation for Jack

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!