Skip to content

Commit 98fb602

Browse files
committed
Optimize operation
1 parent 0851593 commit 98fb602

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pandas/core/generic.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -10102,13 +10102,8 @@ def mask(
1010210102

1010310103
if isinstance(cond, np.ndarray):
1010410104
if all(
10105-
np.apply_along_axis(
10106-
lambda x: x[0] is NA
10107-
or isinstance(x[0], (np.bool_, bool))
10108-
or x[0] is np.nan,
10109-
axis=1,
10110-
arr=cond.flatten().reshape(cond.size, 1),
10111-
)
10105+
x is NA or isinstance(x, (np.bool_, bool)) or x is np.nan
10106+
for x in cond.flatten()
1011210107
):
1011310108
if not cond.flags.writeable:
1011410109
cond.setflags(write=True)

0 commit comments

Comments
 (0)