Skip to content

Commit c589f71

Browse files
committed
Address FutureWarning re inplace=True and fillna
1 parent 6683c91 commit c589f71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pytorch_tabular/categorical_encoders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def transform(self, X):
6868
X_encoded[col] = X_encoded[col].fillna(NAN_CATEGORY).map(mapping["value"])
6969

7070
if self.handle_unseen == "impute":
71-
X_encoded[col].fillna(self._imputed, inplace=True)
71+
X_encoded[col] = X_encoded[col].fillna(self._imputed)
7272
elif self.handle_unseen == "error":
7373
if np.unique(X_encoded[col]).shape[0] > mapping.shape[0]:
7474
raise ValueError(f"Unseen categories found in `{col}` column.")

0 commit comments

Comments
 (0)