-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: bool(scalar) is not the same as scalar.astype(bool) #9847
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
Labels
Comments
eric-wieser
added a commit
to eric-wieser/numpy
that referenced
this issue
Oct 14, 2017
Caused by void scalars decaying to 1d uint8 arrays before casting - `getitem` is dangerous for intermediate results Works towards numpy#9847
eric-wieser
added a commit
to eric-wieser/numpy
that referenced
this issue
Oct 15, 2017
Caused by string values being cast to an int first and then a bool, ie arr.astype(int).astype(bool). This causes crashes on non-numeric strings, and only accepts strings of 0 as false. Fixes numpy#9847
Now that void scalars are fixed, closing in favor of #9875, which is a better summary of the can of worms which strings are. |
theodoregoetz
pushed a commit
to theodoregoetz/numpy
that referenced
this issue
Oct 23, 2017
Caused by void scalars decaying to 1d uint8 arrays before casting - `getitem` is dangerous for intermediate results Works towards numpy#9847
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.
At least, with the
void
type:And the string type:
The text was updated successfully, but these errors were encountered: