def fit(self, X, y):
    for i, k in list(self._column_stages.items()):
        k.fit(X[:, (i)])
return self

def transform(self, X):
    X = X.copy()
for i, k in list(self._column_stages.items()):
    X[:, (i)] = k.transform(X[:, (i)])
return X
scikit-learn: One hot encoding of string categorical features