简体   繁体   English

IndexError:数组的索引太多

[英]IndexError: too many indices for array

I have data (100 data in 1 row)我有数据(1 行 100 条数据)

在此处输入图片说明

This is my code:这是我的代码:

from pylearn2.datasets.csv_dataset import CSVDataset
import pickle

print ('convert: data.csv -> train.pkl')
pyln_data = CSVDataset("data.csv", one_hot=True, delimiter=',')
pickle.dump( pyln_data, open( "train.pkl" , 'w' ) )

but I get this error:但我收到此错误:

y = data[:, 0:self.num_outputs] y = 数据[:, 0:self.num_outputs]
IndexError: too many indices for array IndexError:数组的索引太多

Try y = data[: 0:self.num_outputs] without comma.尝试y = data[: 0:self.num_outputs]不带逗号。 Without more info it difficult to say more.没有更多的信息,很难说更多。 In also you can use this decision .你也可以使用这个决定

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM