Skip to main contentSkip to solution

Match List-I with List-II

List-IList-II
(A) df.drop(column=['A'])(I) Changing the name of a column
(B) df.head(n)(II) Delete column
(C) df.rename(column={'A':'Alpha'})(III) Select first 'n' rows
(D) df.tail(n)(IV) Select the last 'n' rows

Solution

✅ Correct Option: 2
List IList II
(A) df.drop(column=['A'])(II) Delete column
(B) df.head(n)(III) Select first 'n' rows
(C) df.rename(column={'A':'Alpha'})(I) Changing the name of a column
(D) df.tail(n)(IV) Select the last 'n' rows

head means the top of the data, tail means the end. In pandas, the actual keyword is columns (for example df.drop(columns=['A'])), but the match is the same.


Options 1 and 4: swap head and tail. head(n) gives the first n rows and tail(n) gives the last n rows.

Keyboard Shortcuts

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