-
Notifications
You must be signed in to change notification settings - Fork 0
/
MealPrepBarr1.py
33 lines (25 loc) · 1.42 KB
/
MealPrepBarr1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Load the data
usda_recommendations = pd.read_csv('usda_recommendations.csv')
beans_nutrition = pd.read_csv('beans_nutrition.csv')
bread_nutrition = pd.read_csv('bread_nutrition.csv')
# Calculate the amount of beans and toast needed
protein_per_serving = beans_nutrition['Protein'].values[0]
carbohydrates_per_serving = beans_nutrition['Carbohydrates'].values[0]
bread_protein_per_slice = bread_nutrition['Protein'].values[0]
bread_carbohydrates_per_slice = bread_nutrition.values[0]
total_protein_needed = usda_recommendations['Protein'].values[0] / 2
total_carbohydrates_needed = 139
number_of_beans_servings = total_protein_needed / protein_per_serving
number_of_bread_slices = (total_carbohydrates_needed - total_protein_needed * carbohydrates_per_serving / protein_per_serving) / bread_carbohydrates_per_slice
# Prepare the beans and toast
beans = beans_nutrition['Servings'].values[0] * number_of_beans_servings
bread = bread_nutrition['Servings'].values[0] * number_of_bread_slices
# Serve the beans and toast to the patient
print('Serving {} servings of beans and {} slices of bread to the patient.'.format(beans, bread))
# Record the meal in the patient's medical record
icd_11_protein = 'Z79.2'
icd_11_carbohydrates = 'E64.1'
print('Recording the meal in the patient\'s medical record with the ICD 11 codes {} and {}.'.format(icd_11_protein, icd_11_carbohydrates))