I am using an udemy course for MachineLearning and I am trying to form a dummy for my variable the column is
Country I want to change to France Germany Spain
- France 1 0 0
- Spain 0 0 1
- Germany 0 1 0 etc
I tried this but i got this error
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
labelencoder_X = LabelEncoder()
X[:, 0] = labelencoder_X.fit_transform(X[:, 0])
onehotencoder = OneHotEncoder(categorical_values = [0])
X = onehotencoder.fit_transform(X).toarray()
Traceback (most recent call last):
File "", line 4, in onehotencoder = OneHotEncoder(categorical_values = [0])
TypeError: init() got an unexpected keyword argument 'categorical_values'