Skip to content

Commit 16dda53

Browse files
committed
Replace isinstance with is_bool
1 parent f3ed54d commit 16dda53

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pandas/core/generic.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10113,10 +10113,7 @@ def mask(
1011310113
cond = np.array(cond, dtype=object)
1011410114

1011510115
if isinstance(cond, np.ndarray):
10116-
if all(
10117-
x is NA or isinstance(x, (np.bool_, bool)) or x is np.nan
10118-
for x in cond.flatten()
10119-
):
10116+
if all(x is NA or lib.is_bool(x) or x is np.nan for x in cond.flatten()):
1012010117
if not cond.flags.writeable:
1012110118
cond.setflags(write=True)
1012210119
cond[isna(cond)] = False

0 commit comments

Comments
 (0)