Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

one hot encoding python pandas

y = pd.get_dummies(df.Countries, prefix='Country')
print(y.head())
# from here you can merge it onto your main DF
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #hot #encoding #python #pandas
ADD COMMENT
Topic
Name
2+4 =