from sklearn.compose import ColumnTransformer ct = ColumnTransformer([('encoder', OneHotEncoder(),[3]), remainder='passthrough']) x = np.array(ct.fit_transform(x), dtype = np.float)
The correct syntax would be as follows:
import ColumnTransformer
ct = ColumnTransformer([('encoder', OneHotEncoder(),[3]),
],remainder='passthrough')
x = np.array(ct.fit_transform(x), dtype = np.float)