-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Numpy silently assigns zeroes #12449
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
Updated to Numpy version 1.15.4 . The issue still persists. |
This fails for the same reason as: >>> arr = np.array([1, 2, 3])
>>> arr.dtype
int # or something
>>> arr[0] = 1.5
>>> arr.dtype
int # unchanged
>>> arr[0]
1 # 1.5 is not an int, so we had to round Assigning to an array never changes its type. You could argue we should emit a warning or error here, rather than rounding. I think there are multiple issues open about that. |
Duplicate of #8733 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Numpy silently assigns zeroes instead of the correct array if the array has a negative fraction.
Reproducing code example:
Output:
Numpy/Python version information:
OS: Windows 10
Numpy version : 1.14.5
Python version : 3.6.6
1.14.5 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)]
The text was updated successfully, but these errors were encountered: