1

How can I find sqrt of sparse matrix containing negative numbers in python? scipy.sparse.csr_matrix.sqrt and numpy.sqrt doesn't work for negative numbers. I also tried to use cmath.sqrt(mat_name.data). But it's not working also.

galib
  • 93
  • 2
  • 9

1 Answers1

1

from numpy.lib.scimath import sqrt works to find sqrt of sparse matrix with negative numbers. Found the answer here How can I take the square root of -1 using python? from @David Zwicker

galib
  • 93
  • 2
  • 9