Three methods of displaying a histogram.
I have stored sample data in a csv file named df1 in the same folder where I am running this program.
Run this program using Jupyter Notebook
import numpy as np
import pandas as pd
import seaborn as sns
%matplotlib inline
df1 = pd.read_csv('df1', index_col=0)
df1.head()
I have stored sample data in a csv file named df1 in the same folder where I am running this program.
Run this program using Jupyter Notebook
import numpy as np
import pandas as pd
import seaborn as sns
%matplotlib inline
df1 = pd.read_csv('df1', index_col=0)
df1.head()
Method 1: .hist()
df1['A'].hist(bins=30)
Method 2: .plot(kind='hist')
df1['A'].plot(kind='hist', bins=30)
Method 3: .plot.hist()
df1['A'].plot.hist(bins=30)
Comments
Post a Comment