Skip to content
Question 53 of 53

Q.Assertion (A): The drop() method in Pandas can be used to delete rows and columns from a DataFrame. Reason (R): The axis parameter in the drop() method specifies whether to delete rows (axis=0) or columns (axis=1). (A) Both Assertion (A) and Reason (R) are True and Reason (R) is the correct explanation for Assertion (A). (B) Both Assertion (A) and Reason (R) are True and Reason (R) is not the correct explanation for Assertion (A). (C) Assertion (A) is True and Reason (R) is False. (D) Assertion (A) is False, but Reason (R) is True.

CBSECBSE Class XII Board 2025MCQ· 1mImportance★★★★★
100% · 53/53 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

The drop() method in Pandas can delete both rows and columns, and the axis parameter controls which one — so both statements are true, and the reason correctly explains the assertion. The correct option is (A).

The core idea here is understanding how Pandas interprets the axis parameter. In Pandas, axis=0 always refers to the index (rows), and axis=1 refers to the columns. The drop() method is designed to remove data along either axis, and the axis parameter is exactly what tells it which direction to work in. So the reason directly explains how the assertion works — it's not just a separate fact.

Let's walk through it step by step.

  1. Check the Assertion: Does drop() delete both rows and columns?

    Yes. If you call df.drop('row_label') without specifying axis, it defaults to axis=0 and removes that row. If you call df.drop('col_name', axis=1), it removes that column. So the assertion is True.

  2. Check the Reason: Does the axis parameter specify rows vs. columns?

    Yes. axis=0 means "operate along the index" — which translates to dropping rows. axis=1 means "operate along the columns" — dropping columns. So the reason is also True.

  3. Is the reason the correct explanation? …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.