Should numpy.sqrt(-1) return 1j rather than nan?

David Goldsmith David.L.Goldsmith at noaa.gov
Thu Oct 12 02:54:02 CDT 2006


Travis Oliphant wrote:
> David Goldsmith wrote:
>   
>>>   
>>>     
>>>       
>> I don't use scipy (and don't want to because of the overhead) but it 
>> sounds like I should because if I'm taking the square root of a variable 
>> whose value at run time happens to be real but less than zero, I *want* 
>> the language I'm using to return an imaginary; in other words, it's not 
>> the scipy behavior which "scares" me, its the numpy (which I do/have 
>> been using) behavior. 
>>     
>
> O.K.  Well the functions you want are in numpy.lib.scimath.  I should 
> have directed you there.  You actually don't need scipy installed at 
> all.  Just import sqrt from numpy.lib.scimath.  I'm sorry I 
> misunderstood the issue.
>   
Got it.  And if I understand correctly, the import order you specify in 
the little mynumpy example you included in your latest response to 
Fernando will result in any "overlap" between numpy and 
numpy.lib.scimath to call the latter's version of things rather than the 
former's, yes?

DG
> -Travis
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>   


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Numpy-discussion mailing list