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(
96989698 if axis is not None :
96999699 axis = self ._get_axis_number (axis )
97009700
9701+ cond = common .apply_if_callable (cond , self )
9702+
97019703 # We should not be filling NA. See GH#60729
97029704 if isinstance (cond , np .ndarray ):
97039705 cond = np .array (cond )
9704- cond [np . isnan (cond )] = True
9706+ cond [isna (cond )] = True
97059707 elif isinstance (cond , NDFrame ):
97069708 cond = cond .fillna (True )
9709+ elif isinstance (cond , (list , tuple )):
9710+ cond = np .array (cond )
9711+ cond [isna (cond )] = True
97079712
97089713 # align the cond to same shape as myself
9709- cond = common .apply_if_callable (cond , self )
97109714 if isinstance (cond , NDFrame ):
97119715 # CoW: Make sure reference is not kept alive
97129716 if cond .ndim == 1 and self .ndim == 2 :
You can’t perform that action at this time.
0 commit comments