Skip to main contentSkip to solution

Which function is used for dropping the entire row (object) having the missing values?

Solution

✅ Correct Option: 1

df.dropna() removes every row that contains at least one missing value (NaN) from a pandas DataFrame. By default it works on rows (axis=0), so a row with any NaN is dropped completely.


Option 2: df.drop() removes rows or columns by label or index, and it does not look at missing values.

Options 3 and 4: removena() and na() are not pandas DataFrame methods.

Use df.dropna(axis=1) to drop columns with missing values instead.

Keyboard Shortcuts

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