How do i get dummies for this dataset 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 &quot;&lt;ipython-input-9-f7654080cf6a&gt;&quot;, line 4, in &lt;module&gt;
    onehotencoder = OneHotEncoder(categorical_values = [0])

TypeError: __init__() got an unexpected keyword argument 'categorical_values'
As the error says: there is no categorical_values parameter for OneHotEncoder.  It was removed at the same time that OneHotEncoder was extended to deal with strings directly, and you may want to use ColumnTransformer for selecting out the categorical column(s).  For example, https://datascience.stackexchange.com/a/57383/55122