Question: Need help on Python program. It calls on an Excel sheet (medical_records2.csv) for data and I have included the contents of the file with instructions.
Need help on Python program. It calls on an Excel sheet (medical_records2.csv) for data and I have included the contents of the file with instructions.
Week3Homework3Solution: 
Instructions:


Excel:
| Name | Age | Weight | Gender | Gene1000 |
| Janice Ian | 18 | 150 | F | TRUE |
| Frida Collyn | 33 | 280 | NB | FALSE |
| Glen Coco | 18 | 185 | M | FALSE |
| Onyeka Avery | 45 | 124 | NB | TRUE |
| Andy Sanberg | 37 | 200 | M | TRUE |
| Charlie Jung | 73 | 190 | NB | FALSE |
| Michael Jordan | 52 | 212 | M | FALSE |
| Penelope Cruz | 52 | 150 | F | TRUE |
| Aretha Franklin | 85 | 175 | F | FALSE |
| Ismat Robbie | 55 | 129 | NB | TRUE |
| Anthony Jones | 99 | 250 | F | TRUE |
| Janice Jones | 5 | 50 | F | FALSE |
| Frida Kalo | 21 | 200 | F | FALSE |
| Michael Smith | 12 | 130 | M | FALSE |
| Wall E | 3 | 32 | M | TRUE |
| Cedric Digory | 67 | 275 | M | TRUE |
| Qui Kagiso | 17 | 156 | NB | FALSE |
| Ratna Chima | 67 | 126 | F | FALSE |
| Nzinga Lebogang | 73 | 190 | NB | TRUE |
b. Write a program that has the following functions i. load_medical_data (5 points) 1. Function that loads data from "medical_records2.csv" and puts it into a nested dictionary of format { " patient_name":\{'Age":24, "Weight": 156, "Gender": " M " } \}. 2. This function will contain the same code as Week 3 Homework 3 Question 3 (Medical Records). You can either use your own implementation from MedicalRecords.py or use the solution posted on D2L as a starting point. 3. Additional requirements, age and weight should be integers. 4. Input: string filename 5. Output: Dictionary ii. display_patient_weight (10 points) 1. Function that prompts the user for a patient name and displays the weight of the patient 2. If the patient's name is not in the dictionary, display a message stating "Patient not found". 3. Display the patient's weight 4. Input: Dictionary 5. Output: None iii._get_oldest_patient_record (10 points) 1. Function that returns the oldest patient's record in the format (Age, Weight, Gender, Gene1000). 2. Input: Dictionary 3. Output: Oldest Patient's Record iv. delete_patient_by_name (10 points) 1. Function that deletes the patient record selected by the user 2. If the patient's name is not in the dictionary, display a message stating "Patient not found". 3. HINT: The dictionary function pop will be useful. 4. Input: Dictionary 5. Output: None c. Create an "if name main" block to call these functions i. At the bottom of the file, create a block of code to call the functions in the file. Following the example below. ii. The if_name__== "_main_" line of code (line 59) means that only the block of code underneath the if (lines 60 - 76) will run when the file (YOUR_NAME_EHR.py) is called in the terminal. iii. Start with this code as an example and then edit the code in lines 60-76 as you test your functions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
