Skip to content

Commit 01c833a

Browse files
author
florian
committed
Fixed a typo ("return _nan" -> "return_nan")
Changed setting feature names slightly
1 parent 7f50004 commit 01c833a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

category_encoders/ordinal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def fit(self, X, y=None, **kwargs):
144144
self.mapping = categories
145145

146146
X_temp = self.transform(X, override_return_df=True)
147-
self.feature_names = X_temp.columns.tolist()
147+
self.feature_names = X_temp.columns.values.tolist()
148148

149149
# drop all output columns with 0 variance.
150150
if self.drop_invariant:
@@ -323,7 +323,7 @@ def ordinal_encoding(X_in, mapping=None, cols=None, handle_unknown='value', hand
323323
if handle_missing == 'value' and ~data.index.isnull().any():
324324
data.loc[nan_identity] = -2
325325
elif handle_missing == 'return_nan':
326-
data.loc[nan_identity] = -2
326+
data.loc[nan_identity] = np.nan
327327

328328
mapping_out.append({'col': col, 'mapping': data, 'data_type': X[col].dtype}, )
329329

0 commit comments

Comments
 (0)