Skip to content
Merged
Changes from 1 commit
Commits
File filter

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
Change order, simplify condition
  • Loading branch information
krsnik93 committed Jun 21, 2019
commit 71b4e4e46f52db8991aa0495dd8e22fb280c94bc
7 changes: 2 additions & 5 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2444,12 +2444,9 @@ def check_bool_indexer(index: Index, key) -> np.ndarray:
'indexer (index of the boolean Series and of '
'the indexed object do not match).')
result = result.astype(bool)._values
elif is_sparse(result):
result = result.to_dense()
result = np.asarray(result, dtype=bool)
else:
# is_bool_indexer has already checked for nulls in the case of an
# object array key, so no check needed here
if is_sparse(result):
result = result.to_dense()
result = np.asarray(result, dtype=bool)

# GH26658
Expand Down