Skip to content

Commit 4d3a264

Browse files
Daniel SaxtonDaniel Saxton
Daniel Saxton
authored and
Daniel Saxton
committed
Don't modify result
1 parent d71d1ba commit 4d3a264

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/indexing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,8 +2234,9 @@ def check_bool_indexer(index: Index, key) -> np.ndarray:
22342234
elif is_extension_array_dtype(key) and is_bool_dtype(key):
22352235
mask = isna(key)
22362236
if mask.any():
2237-
result[mask] = False
2238-
result = np.asarray(result, dtype=bool)
2237+
result = np.asarray(np.where(~mask, result, False), dtype=bool)
2238+
else:
2239+
result = np.asarray(result, dtype=bool)
22392240
else:
22402241
# key might be sparse / object-dtype bool, check_array_indexer needs bool array
22412242
result = np.asarray(result, dtype=bool)

0 commit comments

Comments
 (0)