2
我有以下numpy的数组:需要对numpy索引进行一些说明?
boxIDx = 3
index = np.array([boxIDs!=boxIDx]).reshape(-1,1)
print('\nbboxes:\t\n', bboxes)
print('\nboxIDs:\t\n', boxIDs)
print('\nIndex:\t\n', index)
输出是:
bboxes:
[[370 205 40 40]
[200 100 40 40]
[ 30 50 40 40]]
boxIDs:
[[1]
[2]
[3]]
Index:
[[ True]
[ True]
[False]]
问:我怎么用我的指数 '删除' 的第三排(的bboxes)?
我曾尝试:
bboxes = bboxes[index,:]
还有:
bboxes = bboxes[boxIDs!=boxIDx,:]
这两者给我下面的错误:
IndexError: too many indices for array
很抱歉,如果这是愚蠢的 - 但我在这里遇到麻烦:/
如何智障我的!谢谢! –