For example I have this np.array:
[[True, True, False, False]
[True, False, True, False]
[False, True, False, True]
[False, False, True, True]]
I want to get the the first index that is True in each row but counting from the back of the row. So expected output is a (4,) array corresponding to each row:
[1, # First index that is True is at index 1
2, # First index that is True is at index 2
3, # First index that is True is at index 3
3] # First index that is True is at index 3