在这部分代码中:
for k, v in Candidates.iteritems():
Device = XDevice[XDevice[:, 1] == k, np.array([2, 3, 4, 5, 6, 7, 8, 9, 10])]
我有这个IndexError:
shape mismatch: indexing arrays could not be broadcast together with shapes (2,) (9,)
答案 0 :(得分:0)
好像你不能同时在两个维度上进行选择!
将它分成两行:
for k, v in Candidates.iteritems():
Device_ = XDevice[XDevice[:, 1] == k,:]
Device = Device_[:,np.array([2, 3, 4, 5, 6, 7, 8, 9, 10])