AI engineering glossary · NumPy pandas visualization

What is categorical dtype?

Categorical dtype (also called category): A pandas data type for a column that takes a limited set of repeated values, such as city or grade. The values are stored once as categories and the column holds small integer codes. It saves memory, speeds up grouping and can carry a meaningful order.

Level: intermediateTopic: NumPy pandas visualization

Categorical dtype: an example

Converting a 10-million-row column of 'Mumbai', 'Delhi' and 'Chennai' with astype('category') cuts its memory use sharply.

Related terms

More NumPy pandas visualization terms

Where you learn it

Categorical dtype is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.