dataframe.notna() function detects existing / non-missing values in a dataframe. The function returns a boolean that has the same size as the object to which it is applied, indicating whether each individual value is a
na value or not. All non-missing values are displayed as true, and missing values are displayed as false.
Note: Characters such as empty strings "or numpy.inf are not considered NA values. (unless you set pandas.options.mode.use_inf_as_na = True).
Syntax: DataFrame.notna ()
Returns: Mask of bool values for each element in DataFrame that indicates whether an element is not an NA value
Example # 1: Use
notna () to find all non-missing values in the data frame.
Let`s use the
dataframe.notna () function to find all non-missing values in the data frame.
| tr> |
As we can see in the output, all non-missing values in the data frame have been matched against true. There is no false value because there is no missing value in the data frame.
Example # 2: Use
notna () to find non-missing values when in
notna () there are missing values.
As we can see in the output, cells that have
na values have been mapped as false and all cells that have non-missing values have been mapped as true.
The ability to identify patterns is an essential component of sensory intelli- gent machines. Pattern recognition is therefore an indispensible component of the so-called “Intelligent Control System...
IRMA is a research-based professional organization dedicated to advancing the concepts and practices of information resource management in modern organizations. The primary purpose of IRMA is to promo...
This book introduces machine learning methods in finance. It features a unified treatment of machine learn...
Roger Jennings is an author and consultant specializing in Microsoft .NET n-tier database applications and data-intensive Windows Communication Foundation (WCF) Web services with SQL Server. He’s be...