错误语句:
y_train, y_test = y[train_index], y[test_index]
TypeError: only integer scalar arrays can be converted to a scalar index
修改:
y_train, y_test = np.array(y)[train_index], np.array(y)[test_index]
参考:https://blog.csdn.net/accumulate_zhang/article/details/78808038