How to Calculate Variability measures (variance SD etc) in Statistics and Python

In this blog, I am going to talk about Variability measures with hands on in python. If you miss my previous blog about Central Tendency and Asymmetry measures with Python, please go to the below link. https://readmedium.com/how-to-calculate-central-tendency-and-asymmetry-measures-in-statistics-and-python-28b2bc10407d
Now it is time for measuring variability of data. Most commonly use measures are variance , standard deviation and coefficient of variance.
Variance, Standard Deviation & Coefficient of variation (CV):
These two measure the distribution of a set of data points around its mean value.
Reason for different formulas of population and sample data: When we are calculating for population data, we are 100% sure about measures. When we are considering sample data, there may be 5 sample data sets and for those 5 different measures. Due to this reason there are different formulas.
Population variance formula:

Sample variance formula:

Here we are obtaining the result based on the difference of data point value from the mean of data set. So data point is close to mean, that means lower result and when it is far, that means higher result. Reason for squaring the difference, is not considering negative values as we taking the distance between one point to another.
Variance Example:











