Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to do label encoding in multiple column at once

# We can use label encoding on multiple column at once by using method
from sklearn.preprocessing import LabelEncoder
df[cat_c] = df[cat_c].apply(LabelEncoder().fit_transform)
 
PREVIOUS NEXT
Tagged: #label #encoding #multiple #column
ADD COMMENT
Topic
Name
7+2 =