Statistical Functions in Python | Set 1(Averages and Measure of Central Location)
Measure of spread functions of statistics are discussed in this article.
1. variance() :- This function calculates the variance i.e
measure of deviation of data, more the value of variance, more the data values are spread. Sample variance is computed in this function, assuming data is of a part of population. If passed argument is empty,
StatisticsError is raised.
2. pvariance() :- This function computes the
variance of the entire population. The data is interpreted as it is of the whole population. If passed argument is empty,
StatisticsError is raised.
Output:
The variance of data is : 0.6666666666666667
The population variance of data is : 0.5555555555555556
3. stdev() :- This function returns the
standard deviation ( square root of sample variance ) of the data. If passed argument is empty,
StatisticsError is raised.
4. pstdev() :- This function returns the population
standard deviation ( square root of population variance ) of the data. If passed argument is empty,
StatisticsError is raised.