Skip to content

ENH: Implemented MultiIndex.searchsorted method ( GH14833) #61435

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
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed incompatible return type issue, and closes issue 14833
  • Loading branch information
GSAUC3 committed May 17, 2025
commit 94f7c44acecc485a6c0d2458737485bfafa6cb92
5 changes: 3 additions & 2 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3857,7 +3857,8 @@ def searchsorted(

for v, i in zip(value, indexer):
if i != -1:
result.append(i if side == "left" else i + 1)
val = i if side == "left" else i + 1
result.append(np.intp(val))
else:
dtype = np.dtype(
[
Expand All @@ -3874,7 +3875,7 @@ def searchsorted(
side=side,
sorter=sorter,
)
result.append(int(pos[0]))
result.append(np.intp(pos[0]))

return np.array(result, dtype=np.intp)

Expand Down
Loading