🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.5 Manual
Examples · Try it in your browser! >>> import numpy as np >>> np.isnan(np.nan) True >>> np.isnan(np.inf) False >>> np.isnan([np.log(-1.),1.,np.log(0)]) array([ True, False, False]) Go BackOpen In Tab ·
🌐
w3resource
w3resource.com › numpy › logic-functions › isnan.php
NumPy Logic functions: isnan() function - w3resource
May 2, 2026 - NumPy.isnan() method Example-3: >>> import numpy as np >>> np.isnan([np.log(-2.),2.,np.log(0)]) Output: array([ True, False, False]) Python - NumPy Code Editor: PREV : isinf() function NEXT : isnat() function  · Follow us on Facebook and ...
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.6.dev0 Manual
Examples · Try it in your browser! >>> import numpy as np >>> np.isnan(np.nan) True >>> np.isnan(np.inf) False >>> np.isnan([np.log(-1.),1.,np.log(0)]) array([ True, False, False]) Go BackOpen In Tab ·
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-isnan-python
numpy.isnan() in Python - GeeksforGeeks
March 8, 2024 - # Python Program illustrating # numpy.isnan() method import numpy as geek # Returns True/False value for each element b = geek.arange(20).reshape(5, 4) print("\n",b) print("\nIs NaN(Not a Number): \n", geek.isnan(b)) b = [[1j], [geek.nan]] ...
🌐
Educative
educative.io › answers › what-is-numpyisnan-in-python
What is numpy.isnan() in Python?
numpy.isnan(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'isnan'>
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.2 Manual
Examples · >>> import numpy as np >>> np.isnan(np.nan) True >>> np.isnan(np.inf) False >>> np.isnan([np.log(-1.),1.,np.log(0)]) array([ True, False, False]) On this page
🌐
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 - Here’s how: import numpy as np # Example array with NaN values arr = np.array([1, 2, np.nan, 4, np.nan, 6]) # Replace NaN values with a specific number, e.g., 0 arr_cleaned = np.where(np.isnan(arr), 0, arr) print("Array after replacing NaN ...
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.1 Manual
Examples · >>> import numpy as np >>> np.isnan(np.nan) True >>> np.isnan(np.inf) False >>> np.isnan([np.log(-1.),1.,np.log(0)]) array([ True, False, False]) On this page
🌐
GeeksforGeeks
geeksforgeeks.org › numpy-isnan-python
numpy.isnan() in Python - GeeksforGeeks
March 8, 2024 - # Python Program illustrating # numpy.isnan() method import numpy as geek # Returns True/False value for each element b = geek.arange(20).reshape(5, 4) print("\n",b) print("\nIs NaN(Not a Number): \n", geek.isnan(b)) b = [[1j], [geek.nan]] ...
🌐
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 - What is nan in Python (float('nan'), math.nan, np.nan) a_nan = np.array([0, 1, np.nan, float('nan')]) print(a_nan) # [ 0. 1. nan nan] source: numpy_nan_replace.py · Since comparing NaN with == returns False, use np.isnan() to check if the value is NaN. numpy.isnan — NumPy v1.26 Manual ·
Find elsewhere
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.3 Manual
Examples · Try it in your browser! >>> import numpy as np >>> np.isnan(np.nan) True >>> np.isnan(np.inf) False >>> np.isnan([np.log(-1.),1.,np.log(0)]) array([ True, False, False]) Go BackOpen In Tab ·
🌐
Sling Academy
slingacademy.com › article › understanding-numpy-isnan-function-4-examples
Understanding NumPy isnan() function (4 examples) - Sling Academy
The numpy.isnan() function is used to check for NaN in an array. It returns a Boolean array of the same shape as the input, indicating whether each element is NaN or not. This is particularly useful in data cleaning, preprocessing, and analysis where NaN values might indicate missing or erroneous ...
🌐
NumPy
numpy.org › doc › 1.14 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v1.14 Manual
>>> np.isnan(np.nan) True >>> np.isnan(np.inf) False >>> np.isnan([np.log(-1.),1.,np.log(0)]) array([ True, False, False])
🌐
pythontutorials
pythontutorials.net › blog › numpy-isnan
Mastering `numpy.isnan`: A Comprehensive Guide — pythontutorials.net
numpy.isnan is a function provided by the NumPy library that is used to test element-wise whether a given array contains NaN values. It returns a boolean array of the same shape as the input array, where each element is True if the corresponding ...
🌐
Kodeclik
kodeclik.com › numpy-isnan
numpy.isnan() in Python
October 27, 2025 - Python’s numpy.isnan() takes an array as input and does an element-wise check for NaN values and returns the results as a boolean array highlighting the locations where an NaN was found.
🌐
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v2.0 Manual
Examples · >>> np.isnan(np.nan) True >>> np.isnan(np.inf) False >>> np.isnan([np.log(-1.),1.,np.log(0)]) array([ True, False, False]) On this page
🌐
AskPython
askpython.com › python › examples › nan-in-numpy-and-pandas
Understanding np.nan in NumPy and Pandas - AskPython
September 30, 2026 - These answers cover the type and missing-value questions that come up when NumPy arrays move into pandas. np.nan is a floating-point NaN value used to mark an unavailable numeric entry. Use np.isnan to detect it in a NumPy array.
🌐
TutorialsPoint
tutorialspoint.com › numpy › numpy_identifying_missing_values.htm
NumPy - Identifying Missing Values
In the example below, we use the np.isnan() function to create a mask that identifies NaN values specifically in the 'age' field of a structured array − · import numpy as np # Creating a structured array with NaN values dtype = [('name', ...
🌐
NumPy
numpy.org › doc › 1.25 › reference › generated › numpy.isnan.html
numpy.isnan — NumPy v1.25 Manual
Examples · >>> np.isnan(np.nan) True >>> np.isnan(np.inf) False >>> np.isnan([np.log(-1.),1.,np.log(0)]) array([ True, False, False]) On this page
🌐
Bomberbot
bomberbot.com › python › mastering-numpys-isnan-the-ultimate-guide-for-python-data-scientists
Mastering NumPy's isnan(): The Ultimate Guide for Python Data Scientists - Bomberbot
This example demonstrates how numpy.isnan() can be used in conjunction with pandas and matplotlib to analyze and visualize missing data patterns in a real-world dataset. It showcases the function's utility in data preprocessing, visualization, and statistical analysis.