[Numpy-discussion] please change mean to use dtype=float

Travis Oliphant oliphant at ee.byu.edu
Tue Sep 19 17:48:05 CDT 2006


Sebastian Haase wrote:

>Hello all,
>I just had someone from my lab coming to my desk saying:
>"My god - SciPy is really stupid ....
>An array with only positive numbers claims to have a negative mean !! "?
>
>  
>
>I was asking about this before ... the reason was of course that her array was 
>of dtype int32 and had many large values  to cause an overflow (wrap 
>around) .
>
>Now that the default for axis is None (for all functions having an axis 
>argument),
>can we please change dtype to default to float64 !?
>  
>

The default is float64 now (as long as you are not using 
numpy.oldnumeric). 

I suppose more appropriately, we could reduce over float for integer 
data-types when calculating the mean as well (since a floating point is 
returned anyway).


-Travis





More information about the Numpy-discussion mailing list