cannot reshape array of size 99 into shape (99,1,2)
时间: 2024-01-19 19:03:19 浏览: 151
详解numpy.reshape中参数newshape出现-1的含义
This error occurs when you are trying to reshape an array into a shape that is not compatible with its size.
In this case, you are trying to reshape an array of size 99 into a shape of (99, 1, 2). This means you want to create an array with 99 rows, 1 column and 2 depth dimensions.
However, this is not possible because the original array only has a size of 99 elements, which means it can only be reshaped into a shape that has a total of 99 elements.
To fix this error, you need to choose a different shape that is compatible with the size of your array. For example, you could reshape the array into a shape of (33, 3, 1) or (9, 11, 1).
阅读全文