成功解决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,)html

 

 

 

 

 

目录数组

解决问题ide

解决思路htm

解决方法索引


 

 

 

 

 

解决问题

Index Error: shape mismatch: indexing arrays could not be broadcast together with shapes (100,) (100,10) ip

 

 

 

 

解决思路

索引错误:形状不匹配:索引数组没法与形状(100,)一块儿广播(100,10)。
当使用其余整数类型的多维数组,访问numpy多维数组时,用于索引的数组须要具备相同的形状。numpy将会被容许去广播(若是可能的话),因此,若要为了实现这一点,数组须要具备相同的维数。ci

参考文章
Stack overflow:shape mismatch: indexing arrays could not be broadcast together with shapes
Indexing Multi-dimensional arraysget

 

 

 

 

解决方法

使两个numpy数组保持形状一致便可!it

相关文章
相关标签/搜索