Different std in pandas vs numpy

In a nutshell, neither is “incorrect”. Pandas uses the unbiased estimator (N-1 in the denominator), whereas Numpy by default does not.

To make them behave the same, pass ddof=1 to numpy.std().

For further discussion, see

  • Can someone explain biased/unbiased population/sample standard deviation?
  • Population variance and sample variance.
  • Why divide by n-1?

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)