|
a |
|
b/mo.py |
|
|
1 |
import pandas as pd |
|
|
2 |
import matplotlib.pyplot as plt |
|
|
3 |
data_patients = pd.read_csv("patient_data.csv") |
|
|
4 |
print("\n the data frame is \n========================================") |
|
|
5 |
print(data_patients) |
|
|
6 |
maximum =data_patients.max() |
|
|
7 |
print("\n the maxmum valuues in the data is \n========================================") |
|
|
8 |
print(maximum) |
|
|
9 |
minimum =data_patients.min() |
|
|
10 |
print("\n the minmum valuues in the data is \n========================================") |
|
|
11 |
print(minimum) |
|
|
12 |
average_data_patients =data_patients["Glucose"].mean() |
|
|
13 |
print("\n the average of Glucose is " , average_data_patients ) |
|
|
14 |
average_data_patients =data_patients["BloodPressure"].mean() |
|
|
15 |
print("\n the average of BloodPressure is " , average_data_patients ) |
|
|
16 |
average_data_patients =data_patients["BMI"].mean() |
|
|
17 |
print("\n the average of BMI is " , average_data_patients ) |
|
|
18 |
average_data_patients =data_patients["Age"].mean() |
|
|
19 |
print("\n the average of Age is " , average_data_patients ) |
|
|
20 |
number_of_the_patients=data_patients[(data_patients['Age'] > 50) & (data_patients['BloodPressure'] >= 70)] |
|
|
21 |
print("\n the number_of_the_patients is \n========================================") |
|
|
22 |
print(number_of_the_patients) |
|
|
23 |
data_patients.plot(kind='box', subplots=True, layout=(2,2), sharex=False, sharey=False) |
|
|
24 |
plt.show() |