ValueError: operands could not be broadcast together with shapes (35063,16) (12,) (35063,16)
时间: 2024-05-30 16:12:56 浏览: 140
This error message typically occurs when you are trying to perform an operation on arrays of different shapes that cannot be broadcast together.
In this case, it seems that you are trying to perform an operation that involves three arrays:
- An array with shape (35063, 16)
- An array with shape (12,)
- An array with shape (35063, 16)
The first and third arrays have the same shape, but the second array has a different shape.
To resolve this error, you need to make sure that the shapes of all the arrays involved in the operation are compatible with each other. This usually involves reshaping or transposing the arrays so that they have the same shape or can be broadcast together.
相关问题
ValueError: operands could not be broadcast together with shapes (140625,) (20,)
这个错误通常是由于两个数组的形状不匹配导致的。在这种情况下,一个数组的形状是(140625,),另一个数组的形状是(20,),两个数组无法被广播在一起进行操作。请检查你的代码,确保你正在使用正确的形状的数组执行相应的操作。你可能需要使用 numpy.reshape() 或 numpy.newaxis 来调整数组的形状以匹配相应的操作。
ValueError: operands could not be broadcast together with shapes (26,) (24,)
这是一个技术问题,可能是由于两个数组的形状不匹配导致的。您可以检查一下这两个数组的形状是否相同,如果不同,可以尝试使用 reshape() 函数将它们的形状调整为相同。如果还是无法解决问题,您可以尝试查看错误信息中提供的更多详细信息,以便更好地理解问题所在。
阅读全文