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 mypy error, closes issue 14833
  • Loading branch information
GSAUC3 committed May 31, 2025
commit 134265760ae183b0814100077b83ed3e262c7130
6 changes: 3 additions & 3 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3864,12 +3864,12 @@ def searchsorted(
result.append(np.intp(val))
else:
fields = []
for i, level in enumerate(self.levels):
for j, level in enumerate(self.levels):
level_dtype = level.dtype
if isinstance(level_dtype, ExtensionDtype):
fields.append((f"level_{i}", object))
fields.append((f"level_{j}", object))
else:
fields.append((f"level_{i}", level_dtype))
fields.append((f"level_{j}", level_dtype))
dtype = np.dtype(fields)

val_array = np.array([v], dtype=dtype)
Expand Down
Loading