Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert categorical data type to int in pandas

from sklearn import preprocessing

lab_encoder = preprocessing.LabelEncoder()
df['column'] = lab_encoder.fit_transform(df['column'])
 
PREVIOUS NEXT
Tagged: #convert #categorical #data #type #int #pandas
ADD COMMENT
Topic
Name
1+2 =