OneHotEncoder categorical_features depreciated, how to transform specific column
问题 I need to transform the independent field from string to arithmetical notation. I am using OneHotEncoder for the transformation. My dataset has many independent columns of which some are as: Country | Age -------------------------- Germany | 23 Spain | 25 Germany | 24 Italy | 30 I have to encode the Country column like 0 | 1 | 2 | 3 -------------------------------------- 1 | 0 | 0 | 23 0 | 1 | 0 | 25 1 | 0 | 0 | 24 0 | 0 | 1 | 30 I succeed to get the desire transformation via using