shape mismatch: value array of shape (6664,) could not be broadcast to indexing result of shape (6664,1)
时间: 2024-01-08 07:05:02 浏览: 92
This error occurs when there is a mismatch between the shape of the input array and the shape of the indexing result. In this case, the input array has a shape of (6664,), which means it has only one dimension with 6664 elements. However, the indexing result has a shape of (6664,1), which means it has two dimensions with 6664 rows and 1 column.
To fix this error, you need to reshape the input array to match the shape of the indexing result. You can do this by adding a new dimension to the input array using the numpy.newaxis attribute.
For example, if your input array is called arr, you can reshape it like this:
arr = arr[:, np.newaxis]
This will add a new dimension to the input array and reshape it to have a shape of (6664,1), which matches the shape of the indexing result.
阅读全文