-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
categorical needs a searchsorted implmentation #8420
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
Milestone
Comments
someting like:
? |
Nope, along this lines
|
I have a fix for this in pull request #8928. >>> x = pd.Categorical(['apple', 'bread', 'bread', 'cheese', 'milk', 'donuts' ])
>>> x.searchsorted(['bread', 'eggs'], side='right', sorter=[0, 1, 2, 3, 5, 4])
# array([3, 5]) # eggs after donuts, after switching milk and donuts
values_as_codes = self.categories.values.searchsorted(Series(v).values, side)
indices = self.codes.searchsorted(values_as_codes, sorter=sorter)
return indices |
closed by #8972 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the
Categorical.searchsorted()
raisesNotImplementedError
.The text was updated successfully, but these errors were encountered: