[SciPy-user] Inconsistent standard deviation and variance implementation in scipy vs. scipy.stats

Pierre GM pgmdevlist@gmail....
Wed Sep 24 11:05:02 CDT 2008


Johann,
You can also get the unbiased estimates with numpy by setting the optional 
parameter ddof=1.

>>> a=np.array([ 1.,  2.,  3.,  2.,  3.,  1.])
>>> np.std(a)
0.81649658092772603
>>> np.std(a, ddof=1)
0.89442719099991586

I think the default to biased estimates was kept for backward compatibility.



More information about the SciPy-user mailing list