What is categorical data in Pandas?

Updated May 17, 2026

Short answer

Categorical data represents fixed categories with limited unique values.

Deep explanation

Pandas stores categories internally as integer codes, improving memory efficiency and performance for repeated string-like values.

Real-world example

Storing gender, country, or product categories.

Common mistakes

  • Using category for highly unique data like IDs.

Follow-up questions

  • Is categorical data ordered?
  • Why use categorical dtype?

More Pandas interview questions

View all →