We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9cd44e commit df626f5Copy full SHA for df626f5
pandas/core/dtypes/missing.py
@@ -223,15 +223,13 @@ def _isna_ndarraylike(obj, old: bool = False):
223
array-like
224
Array of boolean values denoting the NA status of each element.
225
"""
226
- values = getattr(obj, "_values", obj)
+ if not isinstance(obj, np.ndarray):
227
+ values = obj.to_numpy()
228
+ else:
229
+ values = obj
230
dtype = values.dtype
231
- if is_extension_array_dtype(dtype):
- if old:
- result = values.isna() | (values == -np.inf) | (values == np.inf)
232
- else:
233
- result = values.isna()
234
- elif is_string_dtype(dtype):
+ if is_string_dtype(dtype):
235
result = _isna_string_dtype(values, dtype, old=old)
236
elif needs_i8_conversion(dtype):
237
# this is the NaT pattern
0 commit comments