class ColumnExtractor(object):

    def __init__(self, cols):
        self.cols = cols

def transform(self, X):
    col_list = []
for c in self.cols:
    col_list.append(X[:, c:c + 1])
return np.concatenate(col_list, axis=1)

def fit(self, X, y=None):
    return self
How can I use a custom feature selection function in scikit-learn's `pipeline`