-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use ddof=1
for std
& var
#8566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Note also that the In [1]: import numpy as np
In [2]: np_arr = np.array([1.0, 2.0, 3.0])
In [3]: np.std(np_arr, ddof=0)
Out[3]: 0.816496580927726
In [4]: np.std(np_arr, ddof=1)
Out[4]: 1.0
In [5]: from numpy import array_api
<ipython-input-5-54c229be796f>:1: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
from numpy import array_api
In [6]: arr = array_api.asarray([1.0, 2.0, 3.0])
In [7]: array_api.std(arr)
Out[7]: Array(0.81649658, dtype=float64) This is actually currently a bug in xarray's support of the array API standard, because it seems xarray tries to pass the I guess I would like to see |
Actually it seems We should therefore start supporting |
What is your issue?
I've discussed this a bunch with @dcherian (though I'm not sure he necessarily agrees, I'll let him comment)
Currently xarray uses
ddof=0
forstd
&var
. This is:ddof=1
is correctOTOH:
Any thoughts?
The text was updated successfully, but these errors were encountered: