Which of the following function is used to identify the null values in a dataframe?
(A). isnull( )
(B). isna( )
(C). isempty( )
(D). findnull( )
Which of the following function is used to identify the null values in a dataframe?
(A). isnull( )
(B). isna( )
(C). isempty( )
(D). findnull( )
Solution
In pandas, both isnull() and isna() detect missing values (NaN or None). They are aliases of each other and return a DataFrame of the same shape with True where a value is missing. For example, df.isnull().sum() gives the count of nulls in each column.
(C) isempty(): no such method exists. It is confused with the empty attribute, df.empty, which only checks whether the whole DataFrame has no elements.
(D) findnull(): not a pandas function.
Related: notnull() and notna() do the opposite and return True for non-missing values.
Related questions:
2026: 19 May Shift 1
2025: 3 June Shift 2