diff --git a/feature_engine/encoding/one_hot.py b/feature_engine/encoding/one_hot.py index 9d028475b..46032711c 100644 --- a/feature_engine/encoding/one_hot.py +++ b/feature_engine/encoding/one_hot.py @@ -308,7 +308,7 @@ def _get_new_features_name(self) -> List: def _add_new_feature_names(self, feature_names) -> List: """Adds new features to df columns, and removes categoricals.""" - feature_names = feature_names + self._get_new_features_name() feature_names = [f for f in feature_names if f not in self.variables_] + feature_names = feature_names + self._get_new_features_name() return feature_names