Answers for "convert categorical columntype to int in pandas"

0

convert categorical data type to int in pandas

from sklearn import preprocessing

lab_encoder = preprocessing.LabelEncoder()
df['column'] = lab_encoder.fit_transform(df['column'])
Posted by: Guest on November-09-2021

Code answers related to "convert categorical columntype to int in pandas"

Browse Popular Code Answers by Language