By default, np.var()
and np.std()
calculate the population (biased) variance and standard deviation, whereas statistics.variance()
and statistics.stdev()
calculate the sample (unbiased) variance and standard deviation by default.
However, you can calculate the unbiased variance and standard deviation with NumPy by setting the ddof
parameter to 1
.