I have an array A with shape (3,3). I want to identify all non-zero distinct elements and their indices. I present the expected output.
import numpy as np
A=np.array([[10,2,0],[2,20,1.3],[0,1.3,30]])
The expected output is
Distinct=[10,2,20,1.3,30]
Indices=[[(0,0)],[(0,1),(1,0)],[(1,1)],[(1,2),(2,1)],[(2,2)]]