covert a column into object in a datatframe code example Example: how to make a column a factor in pandas df['col_name'] = df['col_name'].astype('category')