1、ValueError: all the input arrays must have same number of dimensions
我的代码是这样的:
total_np_data = np.hstack([x_resample, y_resample])
x_resample和y_resample结果分别是这样的:
哦,原来是不能这样写。
应该写
(1)如果x和y都是矩阵应该写:
total_np_data = np.hstack((x_resample, y_resample))
(2)如果x是矩阵,y是列表应该写:
total_np_data = np.hstack((x_resample, y_resample[:, None])
2、TypeError: hstack() takes 1 positional argument but 2 were given
我的代码是这样的
total_np_data = np.hstack([x_resample, y_resample])
不能这样写,
(1)如果x和y都是矩阵应该写:
total_np_data = np.hstack((x_resample, y_resample))
(2)如果x是矩阵,y是列表应该写:
total_np_data = np.hstack((x_resample, y_resample[:, None])
3、illegal target for annotation
我在if|elif|else
条件之间加了其他语句,这是不可以的