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
很抱歉,如果這是愚蠢的 - 但我在這裏遇到麻煩:/
如何智障我的!謝謝! –