np.isnan can be applied to NumPy arrays of native dtype (such as np.float64):

In [99]: np.isnan(np.array([np.nan, 0], dtype=np.float64))
Out[99]: array([ True, False], dtype=bool)

but raises TypeError when applied to object arrays:

In [96]: np.isnan(np.array([np.nan, 0], dtype=object))
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

Since you have Pandas, you could use pd.isnull instead -- it can accept NumPy arrays of object or native dtypes:

In [97]: pd.isnull(np.array([np.nan, 0], dtype=float))
Out[97]: array([ True, False], dtype=bool)

In [98]: pd.isnull(np.array([np.nan, 0], dtype=object))
Out[98]: array([ True, False], dtype=bool)

Note that None is also considered a null value in object arrays.

Answer from unutbu on Stack Overflow
🌐
GitHub
github.com › numpy › numpy › issues › 24759
BUG: np.isna() is working · Issue #24759 · numpy/numpy · GitHub
September 20, 2023 - --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-5-4ce8187e45dc> in <cell line: 1>() ----> 1 np.isna(np.nan) /usr/local/lib/python3.10/dist-packages/numpy/__init__.py in __getattr__(attr) 309 return Tester 310 --> 311 raise AttributeError("module {!r} has no attribute " 312 "{!r}".format(__name__, attr)) 313 AttributeError: module 'numpy' has no attribute 'isna' Below is the output for the code import sys, numpy; print(numpy.version); print(sys.version) 1.23.5 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] ... Numpy does have isnan, for finding NaN floating point values, and isnat for finding NaT timestamp values.
People also ask

How do I fix 'NoneType object has no attribute'?
The variable you're accessing is None, but you expected an object. Trace back to where it was assigned: a function returning None instead of an object (forgot to return), a database query returning no rows (Model.objects.first() returns None when empty), or an API call that failed silently. Safe pattern: if obj is not None: obj.method() OR use the walrus operator: if (obj := get_obj()): obj.method().
🌐
itsourcecode.com
itsourcecode.com › home › attributeerror: numpy.ndarray object has no attribute values
Attributeerror: numpy.ndarray object has no attribute values
What is Python AttributeError and what causes it?
AttributeError is raised when you access an attribute or method that doesn't exist on the object. Most common cause: calling a method on None (NoneType has no attribute X). Other causes: typo in method name, wrong object type (str when you expected list), or using a feature removed in a newer library version. The error names exactly which type and which missing attribute.
🌐
itsourcecode.com
itsourcecode.com › home › attributeerror: numpy.ndarray object has no attribute values
Attributeerror: numpy.ndarray object has no attribute values
How do I prevent AttributeError from None values?
Three patterns: (1) Always validate function returns (if result is None: raise). (2) Use type hints with Optional[X] to make None-ability explicit. (3) Use the walrus operator + early return: if (val := get_val()) is None: return default; use val. Defensive coding around None-able returns prevents 90% of AttributeError in production.
🌐
itsourcecode.com
itsourcecode.com › home › attributeerror: numpy.ndarray object has no attribute values
Attributeerror: numpy.ndarray object has no attribute values
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.6.dev0 Manual
numpy.isnan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'isnan'># Test element-wise for NaN and return result as a boolean array. ... Input array. outndarray, None, or tuple of ndarray and None, optional
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.5 Manual
numpy.isnan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'isnan'># Test element-wise for NaN and return result as a boolean array. ... Input array. outndarray, None, or tuple of ndarray and None, optional
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.1 Manual
numpy.isnan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'isnan'># Test element-wise for NaN and return result as a boolean array. ... Input array. outndarray, None, or tuple of ndarray and None, optional
🌐
Medium
medium.com › @amit25173 › numpy-isnan-in-python-63b8c185331e
numpy.isnan in Python. If you think you need to spend $2,000… | by Amit Yadav | Medium
February 9, 2025 - What is NaN? NaN stands for "Not a Number." It often represents missing or undefined values in your data. How does numpy.isnan work? It scans through your NumPy array and checks each element.
Find elsewhere
🌐
Itsourcecode
itsourcecode.com › home › attributeerror: numpy.ndarray object has no attribute values
Attributeerror: numpy.ndarray object has no attribute values
July 12, 2026 - This error occurs when you try to access the “values” attribute of a NumPy ndarray object, but it does not exist.
🌐
NumPy
numpy.org › doc › 1.13 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v1.13 Manual
Test element-wise for NaN and return result as a boolean array · out : ndarray, None, or tuple of ndarray and None, optional
🌐
GeeksforGeeks
geeksforgeeks.org › numpy-isnan-python
numpy.isnan() in Python - GeeksforGeeks
March 8, 2024 - The numpy.isnan() function tests element-wise whether it is NaN or not and returns the result as a boolean array. Syntax : numpy.isnan(array [, out]) Parameters : array : [array_like]Input array or object whose elements, we need to test for infinity out : [ndarray, optional]Output array placed with result.
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: Replace NaN (np.nan) using np.nan_to_num() and np.isnan() | note.nkmk.me
January 23, 2024 - NumPy: Meaning of the axis parameter (0, 1, -1) For versions before 1.17, where the nan argument is not implemented, use the following method to replace NaN with values other than 0. You can use np.isnan() to check if values in an ndarray are NaN. a = np.genfromtxt('data/src/sample_nan.csv', delimiter=',') print(a) # [[11.
🌐
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.0 Manual
numpy.isnan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'isnan'># Test element-wise for NaN and return result as a boolean array. ... Input array. outndarray, None, or tuple of ndarray and None, optional
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.2 Manual
numpy.isnan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'isnan'># Test element-wise for NaN and return result as a boolean array. ... Input array. outndarray, None, or tuple of ndarray and None, optional
🌐
Amelt
amelt.net › ホーム › python:attributeerror ‘numpy.ndarray’ object has no attribute ‘fillna’
Python:AttributeError 'numpy.ndarray' object has no attribute 'fillna' | Amelt.net
October 27, 2018 - # Delete a column with missing values train_X = train_df.drop(train_df.columns[np.isnan(train_df).any()], axis=1).values · Related Articles: • AccessVBA/Macro:Change history function, Sample code for user selection function by password, etc… · Please share if you feel this article is useful for someone. https://www.amelt.net/en/iwm/programming-iwm/machine-learning/5396/Python:AttributeError ‘numpy.ndarray’ object has no attribute ‘fillna’ ·
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.3 Manual
numpy.isnan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'isnan'># Test element-wise for NaN and return result as a boolean array. ... Input array. outndarray, None, or tuple of ndarray and None, optional
🌐
Dipy
docs.dipy.org › 1.10.0 › _modules › numpy.html
Source code for numpy
Skip to main content · Back to top · GitHub · Twitter/X · YouTube · LinkedIn · Source code for numpy · """ NumPy ===== Provides 1. An array object of arbitrary homogeneous items 2. Fast mathematical operations over arrays 3. Linear Algebra, Fourier Transforms, Random Number Generation ...
🌐
Medium
medium.com › @amit25173 › understanding-numpy-isnan-what-it-does-1b39c18bb159
Understanding numpy.isnan: What It Does? | by Amit Yadav | Medium
March 6, 2025 - When working with data, this couldn’t be more accurate — especially when dealing with missing values. numpy.isnan is here to save the day. It identifies NaN (Not a Number) values in your NumPy arrays, returning a Boolean array that pinpoints their exact location.
🌐
Saturn Cloud
saturncloud.io › blog › efficiently-checking-if-arbitrary-object-is-nan-in-python-numpy-pandas
Efficiently Checking if Arbitrary Object is NaN in Python Numpy and Pandas | Saturn Cloud Blog
May 1, 2026 - Solution: Stick to one library’s conventions for consistency. For example, if you are working with NumPy arrays, use np.isnan() consistently throughout your code.