I have two numpy arrays, one of a boolean type, the other float type. I want to get the rows of XY_coord where one of the colums has a row with True (so all rows in XY_coord with False-False in BOOL are removed. How do I do this?
BOOL = np.array([[False, True],
[False, True],
[False, True],
[False, True],
[ True, True],
[ True, False],
[False, False],
[False, False],
[ True, False]])
XY_coord = np.array([[-192.9594843 , 78.17485294],
[-182.2699483 , 50.143909 ],
[-171.5804122 , 22.11296505],
[ -51.11635646, 132.2664039 ],
[ -40.42682039, 104.2354599 ],
[ -29.73728432, 76.20451597],
[ 90.72677139, 186.3579548 ],
[ 101.4163075 , 158.3270108 ],
[ 112.1058435 , 130.2960669 ]])
I can do:
XY_coord[out[:,0]]
XY_coord[out[:,1]]
and append the outcome, but my matrix is much larger, so this will be inefficient.