A

Admin • 833.24K Points
Coach

Q. How can you select multiple columns in a DataFrame?

  • (A) df['col1', 'col2']
  • (B) df.col1, df.col2
  • (C) df[['col1', 'col2']]
  • (D) df.select(col1, col2)
  • Correct Answer - Option(C)
  • Views: 22
  • Filed under category Pandas
  • Hashtags:

Explanation by: Admin

Use double brackets to select multiple columns: `df[['col1', 'col2']]`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.