[Numpy-discussion] unexpected downcast

Christopher Barker Chris.Barker@noaa....
Wed Feb 13 15:27:48 CST 2008

Robert Kern wrote:
> That's just what asfarray is designed to do. If you don't give it a dtype, it 
> uses float64.

For the record, it upcasts float32 arrays also.

So why does it exist at all? Is is just syntactic sugar for:

asarray(a, dtype=float64)

Which kind of seems to be not worth it.

If, on the other hand, it meant:

"make this a floating point array, but keep the input precision if it's 
already a float type", that could be useful (and not completely trivial 
to write yourself).


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the Numpy-discussion mailing list