onehotencoder = OneHotEncoder(categorical_features = [0])
X = onehotencoder.fit_transform(X).toarray()

This method dont work and deprecated

integer data will change in version 0.22. Currently, the categories are determined based on the range [0, max(values)], while in the future they will be determined based on the unique values.
If you want the future behaviour and silence this warning, you can specify “categories=‘auto’”.
In case you used a LabelEncoder before this OneHotEncoder to convert the categories to integers, then you can now use the OneHotEncoder directly.
warnings.warn(msg, FutureWarning)
C:\Users\rolan.conda\envs\python35\lib\site-packages\sklearn\ DeprecationWarning: The ‘categorical_features’ keyword is deprecated in version 0.20 and will be removed in 0.22. You can use the ColumnTransformer instead.
“use the ColumnTransformer instead.”, DeprecationWarning)

How implement this methode above ?

Thank you for your help