File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -9698,15 +9698,19 @@ def _where(
9698
9698
if axis is not None :
9699
9699
axis = self ._get_axis_number (axis )
9700
9700
9701
+ cond = common .apply_if_callable (cond , self )
9702
+
9701
9703
# We should not be filling NA. See GH#60729
9702
9704
if isinstance (cond , np .ndarray ):
9703
9705
cond = np .array (cond )
9704
- cond [np . isnan (cond )] = True
9706
+ cond [isna (cond )] = True
9705
9707
elif isinstance (cond , NDFrame ):
9706
9708
cond = cond .fillna (True )
9709
+ elif isinstance (cond , (list , tuple )):
9710
+ cond = np .array (cond )
9711
+ cond [isna (cond )] = True
9707
9712
9708
9713
# align the cond to same shape as myself
9709
- cond = common .apply_if_callable (cond , self )
9710
9714
if isinstance (cond , NDFrame ):
9711
9715
# CoW: Make sure reference is not kept alive
9712
9716
if cond .ndim == 1 and self .ndim == 2 :
You can’t perform that action at this time.
0 commit comments