pandas.isna() function in Python
Last Updated :
14 Aug, 2020
This method is used to detect missing values for an array-like object. This function takes a scalar or array-like object and indicates whether values are missing (“NaN“ in numeric arrays, “None“ or “NaN“ in object arrays, “NaT“ in datetimelike).
Syntax : pandas.isna(obj)
Argument :
- obj : scalar or array-like, Object to check for null or missing values.
Below is the implementation of the above method with some examples :
Example 1 :
Python3
import numpy
import pandas
print (pandas.isna( "deep" ))
print (pandas.isna(numpy.nan))
|
Output :
False
True
Example 2 :
Python3
import numpy
import pandas
array = numpy.array([[ 1 , numpy.nan, 3 ],
[ 4 , 5 , numpy.nan]])
print (array)
print (pandas.isna(array))
|
Output :
[[ 1. nan 3.]
[ 4. 5. nan]]
[[False True False]
[False False True]]
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...