How do you handle categorical data in Pandas, and how does the category dtype save memory and speed up operations?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Explain how to work with categorical columns in Pandas and what the category dtype changes for memory use and speed. Tests how categorical data is stored, ordered categories, measuring memory, groupby and concat pitfalls, and when the dtype is the wrong choice.