We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Numpy no longer automatically truncates Python integers to the destination type. So the following code causes an overflow error now:
input = np.empty((640, 480), dtype=np.uint8, order='F') for y in range(480): for x in range(640): input[x, y] = x ^ (y + 1)
We can recover the old behavior by manually masking.
input = np.empty((640, 480), dtype=np.uint8, order='F') for y in range(480): for x in range(640): input[x, y] = (x ^ (y + 1)) & 0xFF
The text was updated successfully, but these errors were encountered:
Fix Numpy 2.0 compatibility bug in lesson 10
dc531ff
Numpy 2.0 no longer performs narrowing conversions automatically. We manually mask here instead. Fixes #8380
8643007
Successfully merging a pull request may close this issue.
Numpy no longer automatically truncates Python integers to the destination type. So the following code causes an overflow error now:
We can recover the old behavior by manually masking.
The text was updated successfully, but these errors were encountered: