Question:medium

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

Show Hint

isnull() gives a Boolean table. any() then reduces each column to one Boolean.
Updated On: Oct 1, 2026
  • True if all columns contain null values
  • False if no missing values are present in any column
  • True or false for each column depending whether it contains missing values or not
  • A count for missing values in all columns
Show Solution

The Correct Option is C

Solution and Explanation

Step 1: What the question asks.
We find what a chained call of isnull() and any() gives on a DataFrame.

Step 2: Think in two stages.
Stage one is a Boolean mask of missing values. Stage two reduces the mask. The reduction in Pandas works column by column unless told otherwise.

Step 3: Stage one.
df.isnull() keeps the shape of df. A cell is True if it holds NaN or None.

Step 4: Stage two.
any() asks, for each column, whether any cell is True. The answer for a column is one Boolean. All columns together make a Series of Booleans.

Step 5: Compare with similar calls.
df.isnull().sum() would give counts. df.isnull().any().any() would give one single Boolean for the full frame. df.isnull().all() would ask if every cell in a column is missing.

Step 6: Match with the options.
Only option 3 describes a Boolean per column.

Step 7: Why each wrong option fails.
Option 1 and option 2 each describe one single message for the whole table, but any() applied once returns a separate answer for every column. Option 4 describes counts, which are not Booleans. A count would come only from sum(). So only option 3 fits the output.

Final Answer:
The result is a True or False for each column, so option 3. \[ \boxed{3} \]
Was this answer helpful?
0


Questions Asked in CUET (UG) exam