A category column stores each distinct value once in a lookup table and replaces the data with small integer codes, which buys memory savings, meaningful ordering, and cleaner grouping and encoding. This cheatsheet gathers the whole toolkit on one page, from the .cat accessor to the clean-then-convert pipeline and both ML encodings, each snippet annotated line by line. Keep it open while you work, or save the image and pin it nearby.
For the full background, read the guide to categorical data in pandas. To practise, work through the 10 code-along examples.
Download the cheatsheet
Hope this is useful.
[…] Categorical Data in Pandas Cheatsheet […]
[…] Categorical Data in Pandas Cheatsheet […]