from sklearn.preprocessing import MinMaxScaler, LabelEncoder def create_scaler(dataset, feature): mmScaler = MinMaxScaler() return mmScaler.fit(dataset[feature].values.reshape(-1,1)) def create_lEncoder(dataset, feature): lEncoder = LabelEncoder() return lEncoder.fit(dataset[feature])