Skip to main contentSkip to solution

Which of the following function is used to identify the null values in a dataframe?

(A). isnull( )

(B). isna( )

(C). isempty( )

(D). findnull( )

Solution

✅ Correct Option: 3

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.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question