Tuesday, June 16, 2026
HomeLanguagespandas.isna() function in Python

pandas.isna() function in Python

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




# importing package
import numpy
import pandas
  
# string "deep" is not nan value
print(pandas.isna("deep"))
  
# numpy.nan represents a nan value
print(pandas.isna(numpy.nan))


Output :

False
True

Example 2 :

Python3




# importing package
import numpy
import pandas
  
# create and view data
array = numpy.array([[1, numpy.nan, 3], 
                     [4, 5, numpy.nan]])
  
print(array)
  
# numpy.nan represents a nan value
print(pandas.isna(array))


Output :

[[ 1. nan  3.]
 [ 4.  5. nan]]
[[False  True False]
 [False False  True]]
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

1 COMMENT

Most Popular

Dominic
32516 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6897 POSTS0 COMMENTS
Nicole Veronica
12013 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6964 POSTS0 COMMENTS