Index.notna()
Pandas Index.notna()
Detects existing (not missing) values. Returns a Boolean of the same size indicating that the values are not NA. Values not missing are displayed as True. Characters such as empty strings "or numpy.inf are not considered NA values (unless you set pandas.options.mode.use_inf_as_na = True). NA values such as None or numpy.NaN are mapped to false values.
Syntax: Index.notna ()
Parameters: Doesn’t take any parameter.
Returns: numpy.ndarray: Boolean array to indicate which entries are not NA.
Example # 1: Use Index.notna ()
to find all non-missing values in Index.
|
Output:
Now we check for missing values in the index.
|
Output:
The function returned an array object of the same size as the index. True
means no index mark is missing, and False
indicates no index mark.
Example # 2: Use Index.notna ()
to check for missing labels in the Datetime Indexe.
|
Output:
Now we will check if there are tags in the Datetime index.
|
Output:
As we can see from the output, the function returned an array object of the same size as the Datetime index. True
means no index mark is missing, and False
indicates no index mark.