Why doesn't array(a, dtype=single, copy=0) downcast a double array.

Charles R Harris charlesr.harris at gmail.com
Tue Oct 17 13:37:09 EDT 2006


On 10/17/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
>
> Travis Oliphant wrote:
>
> >Charles R Harris wrote:
> >


<snip>

>The long-standing behavior is to raise the error on possible-loss
> >conversion and so my opinion is that we should continue with that
> behavior.
> >
> >
> >
> But, on the other hand, it looks like numarray went the other direction
> and allows a cast using the array call.
>
> Thus
>
> import numarray
> a = numarray.array([1,2,3],'d')
> numarray.array(a, 'f')
>
> works
>
>
> So, I'm willing to go with the numarray behavior in numpy.
>
>
Thanks for the change, Travis. I'll wait a bit to make sure the API remains
stable and then do some cleanups in linalg. Correctness before optimization
and all that. I did note that the LaPack interface could throw an error at
the fortran level that would issue an informative error message and dump me
out of python. Is there anyway you know of to trap this behaviour?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20061017/6d63746e/attachment-0001.html>
-------------- next part --------------
-------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion


More information about the NumPy-Discussion mailing list