I have two lists of indices (idx[0] and idx[1]), and I should delete the corresponding rows from numpy array y_test.
y_test
12 11 10
1 2 2
3 2 3
4 1 2
13 1 10
idx[0] = [0,2]
idx[1] = [1,3]
I tried to delete the rows as follows (using ~). But it didn't work:
result = y_test[(~idx[0]+~idx[1]+~idx[2])]
Expected result:
result =
13 1 10
+, but&for boolean AND operation~[0,2]supposed to do?[0,2]+[1,3]works to join 2 lists producing[0,2,1,3].idxis a numpy array, using the bitwise negation operator on it is not doing what you think it is.