-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
np.nan astype np.int32 gives -2147483648 #13101
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
Emitting a |
My suggestion is to convert np.nan to np.nan as with float32
outputs
|
Integers can't store |
I've just ran into this. So However, it does not seem to be a very deliberate design, because It feel it should be documented, at the least, under the form of a warning or deliberate design. |
@mxt3 note that NumPy currently returns whatever |
This will now give a RuntimeWarning on |
Converting nan to int32 succeeds
Reproducing code example:
outputs
array([-2147483648], dtype=int32)
Error message:
Numpy/Python version information:
np.version == '1.16.1'
The text was updated successfully, but these errors were encountered: