how to make a column a factor in pandas

Solutions on MaxInterview for how to make a column a factor in pandas by the best coders in the world

showing results for - "how to make a column a factor in pandas"
Ariana
12 Jan 2017
1df['col_name'] = df['col_name'].astype('category')
2