A

Admin • 833.24K Points
Coach

Q. What does `df['col'].astype(str)` do?

  • (A) Casts column to object type
  • (B) Casts column to string type
  • (C) Removes NaN values
  • (D) Converts entire DataFrame
  • Correct Answer - Option(B)
  • Views: 20
  • Filed under category Pandas
  • Hashtags:

Explanation by: Admin

`astype(str)` converts all elements in the column to strings.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.