Skip to content

Commit bef7984

Browse files
authored
Merge pull request #772 from a-szulc/master
change X.iloc[:, 1] to X[column_name] so there is no warning from pandas (fixes #750)
2 parents 2b6aa16 + 2cdb009 commit bef7984

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

supervised/algorithms/catboost.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ def fit(
198198
for i in range(X.shape[1]):
199199
if PreprocessingUtils.is_categorical(X.iloc[:, i]):
200200
self.cat_features += [i]
201-
X.iloc[:, i] = X.iloc[:, i].astype(str)
201+
col_name = X.columns[i]
202+
X[col_name] = X[col_name].astype(str)
202203
if X_validation is not None:
203-
X_validation.iloc[:, i] = X_validation.iloc[:, i].astype(str)
204+
X_validation[col_name] = X_validation[col_name].astype(str)
204205

205206
eval_set = None
206207
if X_validation is not None and y_validation is not None:

0 commit comments

Comments
 (0)