I am trying to save a 2D matrix A to text file for each non-zero entry. I would like to save it in the below format,
For the (i,j)-th entry, one line as
where row and column are 1D numpy array corresponding to rows and column indices
But, since shape mismatches, i get error. I do not want to iterate over each row and column indices in a loop (I think it is too time consuming, i have 5000*5000 matrix).