Convert each object column to categorical
object
categorical
df = df.apply(lambda col: col.astype('category') if col.dtypes == 'object' else col)