StopIteration
它在第三行引发data Color = Red|Green|Blue
错误。
答案 0 :(得分:0)
您应加载一次并在加载后拆分数据:
trainfile = open('train.csv')
all_data = np.loadtxt(trainfile, delimiter=',', usecols = (1,2,4,5,9), skiprows = 1)
features_train = alldata[1:, ...]
labels_train = alldata[0, ...]