-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: np.digitize casts integers to float64 #11022
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
Open
Labels
Comments
eric-wieser
added a commit
to eric-wieser/numpy
that referenced
this issue
May 1, 2018
This is due to numpygh-11022.
eric-wieser
added a commit
to eric-wieser/numpy
that referenced
this issue
Jul 6, 2018
This converts digitize to a pure-python function that falls back on searchsorted. Performance doesn't really matter here anyway - if you care about performance, then you should just call searchsorted directly, rather than checking the order of the bins. Partially fixes numpygh-11022
Still broken for decreasing bins - see the |
LemonBoy
added a commit
to LemonBoy/numpy
that referenced
this issue
Aug 18, 2023
Rewrite the underlying C implementation of the monotonicity check in a generic fashion, allowing the use on arrays with comparable types. Closes numpy#11022
LemonBoy
added a commit
to LemonBoy/numpy
that referenced
this issue
Aug 18, 2023
Rewrite the underlying C implementation of the monotonicity check in a generic fashion, allowing the use on arrays with comparable types. Closes numpy#11022
LemonBoy
added a commit
to LemonBoy/numpy
that referenced
this issue
Sep 7, 2023
Rewrite the underlying C implementation of the monotonicity check in a generic fashion, allowing the use on arrays with comparable types. Closes numpy#11022
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.
Which leads to:
The workaround is:
The issue right now is that the monotonicity detection in
digitize
is forcing everything to be case to float64. In almost all cases the user probably already sorted their input, so this is not only pointless overhead, but it's causing harmful behavior too.The text was updated successfully, but these errors were encountered: