成功解决IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (100,)
成功解決IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (100,)
?
?
?
?
?
目錄
解決問題
解決思路
解決方法
?
?
?
?
?
解決問題
Index Error: shape mismatch: indexing arrays could not be broadcast together with shapes (100,) (100,10)?
?
?
?
?
解決思路
索引錯誤:形狀不匹配:索引數(shù)組無法與形狀(100,)一起廣播(100,10)。
當使用其他整數(shù)類型的多維數(shù)組,訪問numpy多維數(shù)組時,用于索引的數(shù)組需要具有相同的形狀。numpy將會被允許去廣播(如果可能的話),所以,若要為了實現(xiàn)這一點,數(shù)組需要具有相同的維數(shù)。
參考文章
Stack overflow:shape mismatch: indexing arrays could not be broadcast together with shapes
Indexing Multi-dimensional arrays
?
?
?
?
解決方法
使兩個numpy數(shù)組保持形狀一致即可!
?
?
?
?
?
總結
以上是生活随笔為你收集整理的成功解决IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (100,)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 成功解决IndexError: arra
- 下一篇: DL之DNN:自定义2层神经网络TwoL