Craete Two Lists of Student Ids & Student Heights

In [1]:
student_id = [101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125]
student_height = [135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 138, 138, 138, 139, 139, 139, 140, 140, 141, 141, 142]

Create a dataframe of these two lists using DataFrame() method

In [2]:
import pandas as pd
studentHeightDf = pd.DataFrame({'student_id': student_id, 'student_height': student_height})

Create a seaborn graph

bins - number of bins to divide data
edgecolor - To have colored edges of histograms
norm_hist = False - To have absolute number of frequency rather than having percentages
kde = False - To remove the kernel density curve
In [3]:
import matplotlib
% matplotlib inline
import seaborn as sns
sns.distplot(studentHeightDf['student_height'], bins=8, kde=False, hist=True,  hist_kws={'edgecolor' : 'black'}, norm_hist=False)
Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x22df817dcf8>

Mean

In [4]:
studentHeightDf['student_height'].mean()
Out[4]:
137.56

Median

In [5]:
studentHeightDf['student_height'].median()
Out[5]:
137.0

Mode

In [6]:
studentHeightDf['student_height'].mode()
Out[6]:
0    136
dtype: int64

Range

In [7]:
studentHeightDf['student_height'].max() - studentHeightDf['student_height'].min()
Out[7]:
7

Standard Deviation

In [8]:
studentHeightDf['student_height'].std()
Out[8]:
2.0832666655999654

Quartile

In [9]:
studentHeightDf['student_height'].quantile([.25, .50, .75])
Out[9]:
0.25    136.0
0.50    137.0
0.75    139.0
Name: student_height, dtype: float64

Skewness

In [10]:
studentHeightDf['student_height'].skew()
Out[10]:
0.5841741737364173

By looking at graph also we can tell that graph is positively skewed

Kurtosis

In [11]:
studentHeightDf['student_height'].kurtosis()
Out[11]:
-0.6861072175412213

Graph is having negative kurtosis. It means that graph has less peakedness than normal grpah.