8000 BUG: nanstd/nanvar gives spurious ComplexWarning when input is real but dtype is complex · Issue #8000 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: nanstd/nanvar gives spurious ComplexWarning when input is real but dtype is complex #8000

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

Open
seberg opened this issue Aug 31, 2016 · 1 comment

Comments

@seberg
Copy link
Member
seberg commented Aug 31, 2016

When the input array is a real array, but the dtype argument is given to be complex, the nanstd and nanvar functions will give a ComplexWarning, even though the complex part is always zero. This is due to the line:

np.subtract(arr, avg, out=arr, casting='unsafe')

where arr is the original type, but avg the new (complex) type, which gives the warning.

@seberg
Copy link
Member Author
seberg commented Aug 31, 2016

When fixing this, grep the nanfunc tests for this issue (for gh-8000 or just 8000) , in case some tests can be simplified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0