shapes (4,5) and (4,5) not aligned: 5 (dim 1) != 4 (dim 0)
时间: 2024-06-05 21:06:01 浏览: 27
This error message occurs when trying to perform a mathematical operation between two arrays with incompatible shapes. In this case, the two arrays have shapes (4,5) and (4,5) respectively, meaning they both have 4 rows and 5 columns. However, the error message states that they are not aligned because the number of columns in the first array (5) does not match the number of rows in the second array (4).
To perform a mathematical operation between two arrays, they must have compatible shapes, meaning the number of columns in the first array must match the number of rows in the second array. To fix this error, either the shape of one of the arrays needs to be changed to match the other, or a different mathematical operation that is compatible with the current shapes must be used.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)