import warningsimport matplotlib.pyplot as pltimport numpy as npimport pandas as pdimport seaborn as snsfrom IPython.core.display import HTMLfrom scipy import statsfrom scipy.stats import uniformwarnings.filterwarnings("ignore")import os# for dirname, _, filenames in os.walk('/kaggle/input'):# for filename in filenames:# print(os.path.join(dirname, filename))
Code
from pathlib import Pathifnot Path("heart.csv").exists(): os.system("wget https://github.com/fecet/sustech-bda-python/raw/master/heart.csv")data = pd.read_csv("heart.csv")print("Shape of the data is ", data.shape)
Shape of the data is (303, 14)
Code
data.head()
age
sex
cp
trestbps
chol
fbs
restecg
thalach
exang
oldpeak
slope
ca
thal
target
0
63
1
3
145
233
1
0
150
0
2.3
0
0
1
1
1
37
1
2
130
250
0
1
187
0
3.5
0
0
2
1
2
41
0
1
130
204
0
0
172
0
1.4
2
0
2
1
3
56
1
1
120
236
0
1
178
0
0.8
2
0
2
1
4
57
0
0
120
354
0
1
163
1
0.6
2
0
2
1
Code
data.dtypes
age int64
sex int64
cp int64
trestbps int64
chol int64
fbs int64
restecg int64
thalach int64
exang int64
oldpeak float64
slope int64
ca int64
thal int64
target int64
dtype: object