text_plain_output_1.png
import numpy as np

import pandas as pd

df = pd.read_csv('/kaggle/input/hearts/heart.csv')

np.shape(df)

df.rename(columns={'cp': 'chest_pain_type', 'trestbps': 'bloodpress_med', 'chol': 'chol_serum', 'fbs': 'bloodsugar_fast', 'restecg': 'rest_ecg', 'thalach': 'max_heartrate', 'exang': 'exc_angina', 'ca': 'major_vessels'}, inplace=True)

df = df.drop_duplicates()
np.shape(df)

Q1 = np.quantile(df['bloodpress_med'], 0.25)
Q3 = np.quantile(df['bloodpress_med'], 0.75)
IQR = Q3 - Q1
min_IQR = Q1 - 1.5 * IQR
max_IQR = Q3 + 1.5 * IQR
low_out = []
high_out = []
for i in df['bloodpress_med']:
    if i < min_IQR:
        low_out.append(i)
    if i > max_IQR:
        high_out.append(i)

print(np.unique(df[['sex', 'chest_pain_type', 'bloodsugar_fast', 'rest_ecg', 'exc_angina', 'slope', 'major_vessels', 'thal']].values))