File tree 1 file changed +5
-14
lines changed
1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change 31
31
from pandas .core .dtypes .cast import infer_dtype_from
32
32
from pandas .core .dtypes .common import (
33
33
is_array_like ,
34
- is_numeric_v_string_like ,
35
34
needs_i8_conversion ,
36
35
)
37
36
from pandas .core .dtypes .missing import (
@@ -89,19 +88,11 @@ def mask_missing(arr: ArrayLike, values_to_mask) -> npt.NDArray[np.bool_]:
89
88
# GH 21977
90
89
mask = np .zeros (arr .shape , dtype = bool )
91
90
for x in nonna :
92
- if is_numeric_v_string_like (arr , x ):
93
- # GH#29553 prevent numpy deprecation warnings
94
- pass
95
- else :
96
- # GH#47480
97
- mask_func = np .vectorize (
98
- lambda value : False if (isna (value ) or value != x ) else True
99
- )
100
- new_mask = mask_func (arr ).astype (bool )
101
- if not isinstance (new_mask , np .ndarray ):
102
- # usually BooleanArray
103
- new_mask = new_mask .to_numpy (dtype = bool , na_value = False )
104
- mask |= new_mask
91
+ # GH#47480
92
+ new_mask = np .vectorize (
93
+ lambda value : False if (isna (value ) or value != x ) else True
94
+ )(arr )
95
+ mask |= new_mask
105
96
106
97
if na_mask .any ():
107
98
mask |= isna (arr )
You can’t perform that action at this time.
0 commit comments