Skip to main contentSkip to solution

What will be the output of df.isnull().any()?

Solution

✅ Correct Option: 3

df.isnull() returns a DataFrame of the same shape, with True wherever a value is missing. Calling .any() on it checks each column and returns True if at least one value in that column is missing. The result is a Series with one True or False per column.


Option 1: that would be .all(), which gives True only if every value in a column is null. .any() needs just one.

Option 2: .any() does not give one overall result. It gives a separate True or False for each column.

Option 4: counts come from df.isnull().sum(), not .any().

Keyboard Shortcuts

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