Sns barplot hides the plot of describe.() printed above the barplot

Hi 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")
print("\n \n")
########################################
print("The dataset head")
print("\n \n")
print(dataset.head())
print("\n \n")


#type(dataset)
########################################
dataset.shape
dataset.head(5)
dataset.sample(5)
#print("\n \n")
print("The dataset describe")
dataset.describe()


########################################
#print("The sex barplot")
#dataset["sex"].unique()
#print("\n \n")
#print("Barplot of sex")
#sns.barplot(dataset["sex"])
#print("\n \n")

If I uncomment the very last part the describe() table disappears and the sns.barplot appears.
I would like to see both.

Please can you help me.

Thankyou.

You need to do print(dataset.describe()) to make it print.

1 Like