Skip to main contentSkip to solution

To find the total number of NaN values in each column, we use _____.

Solution

✅ Correct Option: 3

isnull() returns a DataFrame of True/False values, where True marks a NaN. sum() then adds these column-wise, and since True counts as 1, the result is the number of NaN values in each column, as in df.isnull().sum().


Options 1 and 4: count() counts non-null entries. After isnull() every cell is a True or False value, so it just returns the number of rows for every column.

Options 2 and 4: pandas has no isNaN() method. The correct names are isnull() or isna().

Keyboard Shortcuts

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