categorical feature integer feature socks fox socks box using get_dummies will only encode the string feature and will not change the integer featureas you can see in table - in[ ]pd get_dummies(demo_dftable - one-hot-encoded version of the data from table - leaving the integer feature unchanged integer feature categorical feature_box categorical feature_fox categorical feature_socks if you want dummy variables to be created for the "integer featurecolumnyou can explicitly list the columns you want to encode using the columns parameter thenboth features will be treated as categorical (see table - )in[ ]demo_df['integer feature'demo_df['integer feature'astype(strpd get_dummies(demo_dfcolumns=['integer feature''categorical feature']table - one-hot encoding of the data shown in table - encoding the integer and string features integer feature_ integer feature_ integer feature_ categorical feature_box categorical feature_fox categorical feature_socks categorical variables