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

Fernando Perez fperez.net at gmail.com
Wed Oct 11 18:02:16 CDT 2006


On 10/11/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
> Fernando Perez wrote:

> >There are people who import scipy for everything, others distinguish
> >between numpy and scipy, others use numpy alone and at some point in
> >their life's code they do
> >
> >import numpy as N -> import scipy as N
> >
> >because they start needing stuff not in plain numpy.  Having different
> >APIs and behaviors appear there is, I think, a Seriously Bad Idea
> >(TM).
> >
> >
> I think the SBI is mixing numpy and scipy gratuitously  (which I admit I
> have done in the past).  I'm trying to repent....

Well, the problem is that it may not be so easy not to do so, esp. for
new users.  The fact that scipy absorbs and exposes many numpy
functions makes this a particularly easy trap for anyone to fall into.
The fact that even seasoned users do it should be an indicator that
the 'right thing to do' is anything but obvious, IMHO.

Once the dust settles on numpy 1.0, I think that the issues of how
scipy plays with it, API consistency, coding best practices, etc, will
need serious attention.  But let's cross one bridge at a time :)

Cheers,

f

-------------------------------------------------------------------------
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