In [ ]:
import matplotlib.pyplot as plt #used for visuals
import seaborn as sns # used with plt
import numpy as np #used for all kinds of computations
# most used libraries
In [ ]:
med = [35, 15, 20, 40, 25]
time = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri']
In [ ]:
# for visualizations
plt.figure(figsize=(6,3))
plt.plot(time, med, color = 'green', label = 'dosage')
plt.fill_between(time, med, color= 'pink', alpha= 0.3)
plt.legend()
plt.title('Dosage of Medication over Time')
plt.grid()
plt.show()
No description has been provided for this image
In [ ]:
# create some data about patients
bmi = [42, 21, 30, 32, 50, 47]
medical_cost = [8500, 3300, 2000, 3505, 12000, 8900]
patient_type = ['high', 'low', 'low', 'low', 'high', 'high']
In [ ]:
#visualize
plt.figure(figsize= (4,3)) #second step
sns.scatterplot(x=bmi, y=medical_cost, s=100, color='red')# first step, s is the dot size
sns.kdeplot(x=bmi, y=medical_cost, hue=patient_type, levels=5) #third step to cluster patients, levels is for less rings
plt.show()
No description has been provided for this image
In [ ]:
!jupyter nbconvert --to html bana310_082825_notes.ipynb
[NbConvertApp] Converting notebook bana310_082825_notes.ipynb to html
[NbConvertApp] WARNING | Alternative text is missing on 2 image(s).
[NbConvertApp] Writing 350965 bytes to bana310_082825_notes.html
In [ ]: