text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

import warnings

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder, OneHotEncoder, StandardScaler
from sklearn.model_selection import StratifiedKFold
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from termcolor import colored
from sklearn.utils import shuffle
import warnings
warnings.filterwarnings('ignore')
plt.style.use('ggplot')

data = pd.read_csv('../input/personal-key-indicators-of-heart-disease/heart_2020_cleaned.csv')

data.describe().T

diabetic_map = {'No, borderline diabetes': 'No', 'Yes (during pregnancy)': 'Yes', 'Yes': 'Yes', 'No': 'No'}
data.Diabetic = data.Diabetic.map(diabetic_map)

plt.figure(figsize=(10, 5))
sns.countplot('Sex', hue='HeartDisease', data=data)
plt.title('Heart Disease for Different Genders', size=15)
plt.show()