[Numpy-discussion] unexpected downcast

Christopher Barker Chris.Barker at noaa.gov
Wed Feb 13 16:27:48 EST 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).

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

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

Chris.Barker at noaa.gov



More information about the NumPy-Discussion mailing list