AIM-PIbd-32-Borovkov-M-V/Lab_1/lab1.ipynb
2024-09-28 10:58:24 +04:00

112 KiB

In [48]:
import pandas as pd

df = pd.read_csv("../data/healthcare-dataset-stroke-data.csv", index_col="id")

data = df.copy()
hypertension_df = data[data["hypertension"] == 1]
heart_disease_df = data[data["heart_disease"] == 1]

hypertension_df.groupby(["gender"]).size().plot(kind='pie', y='gender', autopct='%1.0f%%')
Out[48]:
<Axes: >
No description has been provided for this image
In [49]:
heart_disease_df.groupby(["gender"]).size().plot(kind='pie', y='gender', autopct='%1.0f%%')
Out[49]:
<Axes: >
No description has been provided for this image
In [50]:
hypertension_df.plot.hist(column=["age"], bins=80)
Out[50]:
<Axes: ylabel='Frequency'>
No description has been provided for this image
In [51]:
heart_disease_df.plot.hist(column=["age"], bins=80)
Out[51]:
<Axes: ylabel='Frequency'>
No description has been provided for this image
In [52]:
heart_disease_df.groupby(["work_type"]).size().plot(kind='pie', y='work_type', autopct='%1.2f%%')
Out[52]:
<Axes: >
No description has been provided for this image
In [53]:
hypertension_df.groupby(["work_type"]).size().plot(kind='pie', y='work_type', autopct='%1.2f%%')
Out[53]:
<Axes: >
No description has been provided for this image
In [53]: