A

Admin • 828.03K Points
Coach

Q. Which is the correct method to rename columns?

  • (A) df.rename(columns={'old': 'new'})
  • (B) df.columns.rename({'old': 'new'})
  • (C) df.rename_column({'old': 'new'})
  • (D) df.change_names({'old': 'new'})
  • Correct Answer - Option(A)
  • Views: 9
  • Filed under category Pandas
  • Hashtags:

Explanation by: Admin
`rename()` with `columns` parameter allows renaming specific columns.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.