Error底下也给了debug提示: Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
问题ValueError: Expected 2D array, got 1D array instead期望2维数组,输入的是一维数组解决Error底下也给了debug提示:Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.即newData = np.array