Skip to content

Commit 9764b19

Browse files
authored
train_test_split incorrect column names fix (#998)
* train_test_split incorrect column names fix * fix pep8 issue
1 parent 7a39c0a commit 9764b19

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

daal4py/sklearn/model_selection/_split.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ def _daal_train_test_split(*arrays, **options):
237237
train_arr.index = train
238238
test_arr.index = test
239239

240+
if hasattr(arr, 'columns'):
241+
train_arr.columns = arr.columns
242+
test_arr.columns = arr.columns
243+
244+
if hasattr(arr, 'name'):
245+
train_arr.name = arr.name
246+
test_arr.name = arr.name
247+
240248
res.append(train_arr)
241249
res.append(test_arr)
242250

0 commit comments

Comments
 (0)