I have a sparse matrix below.
a = sparse.diags([1,2,3],[-1,0,1],shape=(6,6),format ="csr")
I want to take the reciprocal of each of the elements in the sparse matrix. I search it on the internet and notice that taking the reciprocal is barely mentioned. I know numpy has a reciprocal function. np.reciprocal() But it does not work in my case.
It does not have to have such a recipical function. If somebody can provide an elementwise division function of two sparse matrices of same size, or elementwise power function(power of -1), that will also be great.
Thank you So much.