我有一个尺寸为(1500,5)的输入训练数据集和一个(1499,1)的输出训练数据集。请提出可以消除该错误的建议。
Error: Y = dataframe1[:,0]
IndexError: too many indices for array
代码:
dataframe = np.genfromtxt('DataInput.csv', delimiter=",")
#pandas.read_csv("DataInput.csv", delim_whitespace=True, header=None)
#dataset = dataframe.values
dataframe1 = np.genfromtxt("OptimizedSpeed.csv", delimiter=",")
#dataset1 = dataframe1.values
# split into input (X) and output (Y) variables
X = dataframe[:,0:4]
**Y = dataframe1[:,0]** <-- this line shows the error