Too many indexs的问题来源于此处Y_train的数据输入格式不对,当它是list的时候,只有一个索引项。
因此Y_train = pd.DataFrame(Y_train);或者去掉二维索引。
--------------------------------------------------------------------------- IndexingError Traceback (most recent call last) <ipython-input-382-7bcf6a19383c> in <module>() ----> 1 printing_Kfold_scores(X_train,Y_train) <ipython-input-381-10ddfd0bef76> in printing_Kfold_scores(x_train_data, y_train_data) 4 for iteration, indices in enumerate(fold,start