Different std in pandas vs numpy

前端 未结 2 2042
醉话见心
醉话见心 2020-12-08 19:21

The standard deviation differs between pandas and numpy. Why and which one is the correct one? (the relative difference is 3.5% which should not come from rounding, this is

2条回答
  •  清歌不尽
    2020-12-08 20:00

    For pandas to performed the same as numpy, you can pass in the ddof=0 parameter, so df.std(ddof=0).

    This short video explains quite well why n-1 might be preferred for samples. https://www.youtube.com/watch?v=Cn0skMJ2F3c

提交回复
热议问题