Skip to content

Commit 044d0a9

Browse files
committed
fillna after constructor
1 parent 88b0530 commit 044d0a9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/core/generic.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9715,12 +9715,10 @@ def _where(
97159715
else:
97169716
if not hasattr(cond, "shape"):
97179717
cond = np.asanyarray(cond, dtype=object)
9718-
if not cond.flags.writeable:
9719-
cond.setflags(write=True)
9720-
cond[isna(cond)] = True
97219718
if cond.shape != self.shape:
97229719
raise ValueError("Array conditional must be same shape as self")
97239720
cond = self._constructor(cond, **self._construct_axes_dict(), copy=False)
9721+
cond = cond.fillna(True)
97249722

97259723
# make sure we are boolean
97269724
fill_value = bool(inplace)

0 commit comments

Comments
 (0)