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
條件之間加了其他語句,這是不可以的