A guide to handling categorical variables in Python