File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -125,14 +125,18 @@ def mask_missing(arr: ArrayLike, values_to_mask) -> npt.NDArray[np.bool_]:
125
125
new_mask [arr_mask ] = arr [arr_mask ] == x
126
126
else :
127
127
# GH#47101
128
- # Fix where type 'bool' has no attribute 'to_numpy()' by first attempting to broadcast
129
- # with np.equal for some cases, and then an explicit type check when checking the mask
130
- # for any straggling cases
128
+ # Fix where type 'bool' has no attribute 'to_numpy()' by first
129
+ # attempting to broadcast with np.equal for some cases, and then
130
+ # an explicit type check when checking the mask for any straggling
131
+ # cases
131
132
new_mask = np .equal (arr , x )
132
133
133
134
if not isinstance (new_mask , np .ndarray ):
134
135
# usually BooleanArray
135
- new_mask = np .array ([new_mask ]) if isinstance (new_mask , bool ) else new_mask .to_numpy (dtype = bool , na_value = False )
136
+ if isinstance (new_mask , bool ):
137
+ new_mask = np .array ([new_mask ])
138
+ else :
139
+ new_mask = new_mask .to_numpy (dtype = bool , na_value = False )
136
140
mask |= new_mask
137
141
138
142
if na_mask .any ():
You can’t perform that action at this time.
0 commit comments