ValueError: Must pass 2-d input. shape=(189, 3, 14)
时间: 2024-05-05 22:15:30 浏览: 356
python3.7解决最小二乘遇到ValueError:Expected 2D array, got 1D array instead: array=[5.].关于reshape和predict
This error message is indicating that the input data must have two dimensions, but it currently has three dimensions with shapes (189, 3, 14).
To resolve this error, you can try reshaping the data to have two dimensions. One possible way to do this is to use the numpy.reshape() function:
```
import numpy as np
# assuming your input data is stored in a variable called "data"
reshaped_data = np.reshape(data, (189, 42)) # combines the last two dimensions into one
```
This will reshape the data into an array with shape (189, 42), which should be compatible with whatever function you're trying to use.
If you're not sure why your data has three dimensions in the first place, you may need to investigate how it was generated or processed to see if there's a step where it can be flattened or reshaped.
阅读全文