image_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sb

train_data = pd.read_csv('/kaggle/input/heartbeat/mitbih_train.csv', header=None)

test_data = pd.read_csv('/kaggle/input/heartbeat/mitbih_train.csv', header=None)

train_target = train_data[187].value_counts()

np.random.seed(2018)
sample = np.random.choice(train_data.shape[0], 200, replace=False)
subset = train_data.loc[sample]

percentages = [count / subset.shape[0] * 100 for count in subset[187].value_counts()]
percentages[0]

np.random.seed(2020)
sample2 = np.random.choice(test_data.shape[0], 200, replace=False)
subset2 = test_data.loc[sample2]

percentages = [count / subset2.shape[0] * 100 for count in subset2[187].value_counts()]
percentages[0]

for i in np.arange(len(percentages)):
    print(f'the precent of {int(test_data.index[i])} is : {np.round(percentages[i], 2)} %')