xxxxxxxxxx
sns.distplot(gapminder['lifeExp'], kde=False, color='red', bins=100)
plt.title('Life Expectancy', fontsize=18)
plt.xlabel('Life Exp (years)', fontsize=16)
plt.ylabel('Frequency', fontsize=16)
xxxxxxxxxx
import pandas as pd
import seaborn as sns
df = pd.read_csv("https://jbencook.s3.amazonaws.com/data/dummy-sales-large.csv")
# Plot the histogram
sns.histplot(df, x="revenue")
xxxxxxxxxx
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Histplot from seaborn
sns.histplot(data = df, x = "col", stat = "probability", discrete = True)
# Alternative : Distplot from Seaborn
sns.distplot(df['col'], kde=False, color='red', bins=100)
# Pandas underlying hist plot
df['col'].plot.hist()
plt.show()
xxxxxxxxxx
# Import necessary libraries
import numpy as np
import pandas as pd
import seaborn as sns
# Load dataset
tips = sns.load_dataset("tips")
# Plot histogram
sns.histplot(data = tips, x = "size", stat = "probability", discrete = True)