S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which pandas method converts a Series with categorical values to category dtype?

  • (A) astype('category')
  • (B) to_category()
  • (C) categorical()
  • (D) convert_category()
  • Correct Answer - Option(A)
  • Views: 1
  • Filed under category Pandas
  • Hashtags:

Explanation by: Shyam Dubey
astype('category') converts a Series to a categorical data type, which is memory efficient.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.