πŸ“Š Pandas
Q. Which pandas method converts a Series with categorical values to category dtype?
  • (A) astype('category')
  • (B) to_category()
  • (C) categorical()
  • (D) convert_category()
πŸ’¬ Discuss
βœ… Correct Answer: (A) astype('category')

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
56
Total Visits
πŸ“½οΈ
5 mo ago
Published
πŸŽ–οΈ
Sikhar Chaudhary
Publisher
πŸ“ˆ
97%
Success Rate