We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b4d109 commit 6d4afbcCopy full SHA for 6d4afbc
pandas/core/dtypes/missing.py
@@ -223,13 +223,15 @@ def _isna_ndarraylike(obj, old: bool = False):
223
array-like
224
Array of boolean values denoting the NA status of each element.
225
"""
226
- if not isinstance(obj, np.ndarray):
227
- values = obj.to_numpy()
228
- else:
229
- values = obj
+ values = getattr(obj, "_values", obj)
230
dtype = values.dtype
231
232
- if is_string_dtype(dtype):
+ if is_extension_array_dtype(dtype):
+ if old:
+ result = values.isna() | (values == -np.inf) | (values == np.inf)
+ else:
233
+ result = values.isna()
234
+ elif 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