indices of true boolean array pyton

np.where(A)

Here is what the above code is Doing:
1. np.where(A) returns the indices of the elements of A that are non-zero.
2. The first element of the result is a list of row indices of the non-zero elements.
3. The second element of the result is a list of column indices of the non-zero elements.
4. The third element of the result is the values of the non-zero elements.