Hello experts.
I have the following code:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
import os
print(os.listdir())
import warnings
warnings.filterwarnings('ignore')
dataset = pd.read_csv("heart.csv")
type(dataset)
dataset.shape
print('\n \n')
print('Dataset Head')
print('\n \n')
print(dataset.head(5))
print('\n \n')
dataset.sample(5)
print('\n \n')
print('Dataset Describe')
print(dataset.describe())
print('\n \n')
print('Dataset info')
print(dataset.info())
print(dataset.info())
print('\n \n')
print('\n \n')
for i in range(len(info)):
print(dataset.columns[i]+":\t\t\t"+info[i])
dataset["target"].describe()
print('\n \n')
dataset["target"].unique()
#####################################
print('\n \n')
print(dataset.corr()["target"].abs().sort_values(ascending=False))
y = dataset["target"]
print('\n \n')
##### Barplot
sns.countplot(y)
#################################################
target_temp = dataset.target.value_counts()
print('\n \n')
print(target_temp)
print('\n \n')
print("Percentage of patience without heart problems: "+str(round(target_temp[0]*100/303,2)))
print("Percentage of patience with heart problems: "+str(round(target_temp[1]*100/303,2)))
dataset["sex"].unique()
#########################################
##### Barplot
sns.barplot(dataset["sex"])
###################################
dataset["cp"].unique()
##########################
##### Barplot
sns.barplot(dataset["cp"])
My problem is whatever barplot I plot I get the same one, the first one.
The dataset is heart.csv from heart disease prediction project.
Please help.