if self.columns is not None:
    for col in self.columns:
        output[col] = LabelEncoder().fit_transform(output[col])
else:
    for colname, col in output.items():
        output[colname] = LabelEncoder().fit_transform(col)
return output

def fit_transform(self, X, y=None):
    return self.fit(X, y).transform(X)
Label encoding across multiple columns in scikit-learn