Implementing Descriptive Statistics with Python.

In my previous story of this publication, i explained about descriptive statistics. This story will let you know how to implement descriptive statistics with python.
I will be using pandas library.

Import modules

import pandas as pd

Create dataframe

data = {'name': ['John', 'Michael', 'Tina', 'Jake', 'Jashon','Jane'], 
'age': [42, 52, 36, 24, 73,25],
'preTestScore': [4, 24, 31, 2, 3, 22],
'postTestScore': [25, 94, 57, 62, 70, 34]}
df = pd.DataFrame(data, columns = ['name', 'age', 'preTestScore', 'postTestScore'])
df

Mean preTestScore

df['preTestScore'].mean()

Summary statistics on preTestScore

df['preTestScore'].describe()

Summary statistics of Data Frame

df.describe()

Minimum value of preTestScore

df['preTestScore'].min()

Maximum value of preTestScore

df['preTestScore'].max()

Median value of preTestScore

df['preTestScore'].median()

Sample variance of preTestScore values

df['preTestScore'].var()

Sample standard deviation of preTestScore values

df['preTestScore'].std()

Skewness of preTestScore values

df['preTestScore'].skew()

Kurtosis of preTestScore values

df['preTestScore'].kurt()

Thanks for reading.

If you like this post, give this post some claps for motivation . You can share this on Facebook, Twitter, Linkedin, so someone in need cross through this.

You can reach me at : linkedin.com/in/anant-jaiswal-b0a151129/

--

--