成功解决IndexError: index 14 is out of bounds for axis 1 with size 14
生活随笔
收集整理的這篇文章主要介紹了
成功解决IndexError: index 14 is out of bounds for axis 1 with size 14
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
成功解決IndexError: index 14 is out of bounds for axis 1 with size 14
?
?
目錄
解決問題
解決思路
解決方法
?
?
?
解決問題
IndexError: index 14 is out of bounds for axis 1 with size 14
?
解決思路
索引錯誤:索引14超出軸1的界限,大小為14
?
解決方法
? ? ? ?自定義的列表混淆,向上查找正確的自定義參數!參數是df_test_5而不是最最上邊定義的df_test參數,因為兩者的shape不一樣,所以會導致索引錯誤!
test = df_test.filter(regex='Age_.*|SibSp|Parch|Fare_.*|Cabin_.*|Embarked_.*|Sex_.*|Pclass.*|Mother|Child|Family|Title')print('開始輸出predictions') predictions = bagging_clf.predict(test)改為test = df_test_5.filter(regex='Age_.*|SibSp|Parch|Fare_.*|Cabin_.*|Embarked_.*|Sex_.*|Pclass.*|Mother|Child|Family|Title')print('開始輸出predictions') predictions = bagging_clf.predict(test)?
總結
以上是生活随笔為你收集整理的成功解决IndexError: index 14 is out of bounds for axis 1 with size 14的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 成功解决ImportError: [jo
- 下一篇: ML之LoRBaggingRF:依次利用