I did not quite understand what you wanted (maybe an example will help), but two guesses:
If you want to see if there are any Trues in the line, then:
np.any(a, axis=1)
.
True ,
testarray = np.array([
[True, False, True],
[True, True, False],
[False, False, False],
[False, True, False]])
collists = [ np.nonzero(t)[0] for t in testarray ]
:
>>> collists
[array([0, 2]), array([0, 1]), array([], dtype=int64), array([1])]
True 3, :
>>> collists[3]
array([1])
, , . . , , 10000 x 10000, 774 .