Answers for "pandas histogram plot"

13

matplotlib histogram

import matplotlib.pyplot as plt
data = [1.7,1.8,2.0,2.2,2.2,2.3,2.4,2.5,2.5,2.5,2.6,2.6,2.8,
        2.9,3.0,3.1,3.1,3.2,3.3,3.5,3.6,3.7,4.1,4.1,4.2,4.3]
#this histogram has a range from 1 to 4
#and 8 different bins
plt.hist(data, range=(1,4), bins=8)
plt.show()
Posted by: Guest on March-15-2020
1

pandas plot histogram

ax = df.plot.hist(bins=12, alpha=0.5)
Posted by: Guest on May-24-2021
2

plot histogram in seaborn

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)
Posted by: Guest on May-30-2020
0

show distribution pandas coloumns

df['age'] == ['14','16','23','54']
df['age'].hist()
Posted by: Guest on December-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language