numpy loadtxt StopIteration错误

时间:2017-09-09 17:40:50

标签: python numpy

StopIteration

它在第三行引发data Color = Red|Green|Blue 错误。

1 个答案:

答案 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, ...]