ValueError: cannot reshape array of size 502850 into shape (50285,1)
时间: 2024-05-19 16:14:38 浏览: 118
This error message occurs when you try to reshape an array into a shape that is not compatible with its original size. In this specific case, the array has a size of 502850, which means it contains 502850 elements. However, you are trying to reshape it into a shape of (50285,1), which would make it a 2-dimensional array with 50285 rows and 1 column, for a total of 50285 elements. Since 502850 is not evenly divisible by 50285, the reshape operation cannot be performed.
To fix this error, you need to choose a shape that is compatible with the original size of the array. For example, you could reshape it into a shape of (10057,50), which would create a 2-dimensional array with 10057 rows and 50 columns, for a total of 502850 elements. Alternatively, you could reshape it into a shape of (502850,), which would create a 1-dimensional array with 502850 elements.
阅读全文