-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Wrong std for implicitly complex input #13110
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
I'd bet this is a somewhat pervasive issue... |
I’m not sure that you could make object arrays still useful and prevent this kind of thing. Types can only help you if you actually use them. Making an object array is opting out of that help. |
@ewmoore: The only reason this is a problem is an incorrect optimization that avoids calling Lines 118 to 121 in 6b3ea20
If the optimization is reframed as avoiding calling conjugate on |
I think conjugate on object used to be broken, but it is not anymore, so we should fix this! |
@eric-wieser, sorry for the noise then. I didn't look, and assumed what the bug was. |
Hmmm, of course fixing it could in principle break arrays with object types that do not support |
…array. Removed a typo from initial commit.
Please close. This has been fixed, but the github autoclosing didn't kick in. I think the reason is that the "closes" keyword was in a commit message, and the committer doesn't have write access to the repo. Had it been in the PR's description the auto closing would have worked. |
thanks! |
Standart deviation formula could give unexpected result (e.g. imaginary values) when input is implicitly complex.
Reproducing code example:
Error message:
Numpy/Python version information:
numpy 1.16.2
python 3.7
res=0.5j, dtype=object
res=0.5, dtype=complex128
The text was updated successfully, but these errors were encountered: