Skip to content

Commit b324df0

Browse files
committed
Instead of raising a KeyError in case a key is available in a level but not found with the combination of previous keys an empty array is returned.
1 parent c35eca3 commit b324df0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexes/multi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3288,7 +3288,7 @@ def _to_bool_indexer(indexer) -> npt.NDArray[np.bool_]:
32883288
else:
32893289
indexer &= lvl_indexer
32903290
if not np.any(indexer) and np.any(lvl_indexer):
3291-
raise KeyError(seq)
3291+
return np.array([], dtype=np.intp)
32923292

32933293
# empty indexer
32943294
if indexer is None:

0 commit comments

Comments
 (0)