-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Strange result (and no error/warning) for np.min() on integer array with initial=np.nan #12454
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 agree, |
@hameerabbasi, want to take a go at this at some point? |
Is the arbitrary object as identity PR already merged? If so, I can change the casting to safe, and it shouldn’t affect anything. If not, we’ll need that to be merged first. |
Yes, that PR is merged - although I'm not sure I see the connection. |
If we changed the casting rule to safe without that, the casting from |
Oh, maybe. Ultimately I think we're going to want a different identity for each loop type, but that's probably not going to happen any time soon Can we apply the casting rule to just the |
The error seems to be at numpy/numpy/core/src/umath/reduction.c Line 489 in 28e5c07
PyArray_FillWithScalar function, and I'm not sure we'd want to. If we changed it before and after there would be thread safety concerns.
|
We could try casting before and raise an error if a failure occurs. |
I found |
I know that
np.nan
is not an integer, but I was still surprised about this behavior:Reproducing code example:
Result:
I'm not sure what I was expecting, but somehow I felt that I have to report this ...
Error message:
No error, no warning.
Numpy/Python version information:
1.15.0 3.6.7 (default, Oct 21 2018, 08:08:16)
[GCC 8.2.0]
The text was updated successfully, but these errors were encountered: