When I take the square root of -1 it gives me an error:
invalid value encountered in sqrt
How do I fix that?
///
I just discovered the convenience function numpy.lib.scimath.sqrt explained in the sqrt documentation. I use it as follows:
numpy.lib.scimath.sqrt
>>> from numpy.lib.scimath import sqrt as csqrt >>> csqrt(-1) 1j