[SciPy-user] casting complex numbers

Christian Kristukat ckkart at hoc.net
Fri Feb 17 21:47:15 CST 2006


Ryan Krauss wrote:
> Actually, I may have a small problem in that nls.sqrt cannot take a
> vector input.
> 

You could try this:

sqrt = vectorize(nls.sqrt)

sqrt([-1,3])

array([ 0.        +1.j,  1.73205081+0.j])

Christian



More information about the SciPy-user mailing list