[SciPy-user] array mean issue...

Bruce Southey bsouthey@gmail....
Wed Jun 11 08:14:50 CDT 2008


fred wrote:
> Jean-Pascal Mercier a écrit :
>   
>> Hi Fred,
>>
>> The problem is the container used to calculate the mean. The default 
>> behavior is to use the same container as the passed array dtype. When 
>> the array is really big, the float32 container simply become very 
>> inefficient which account for the error you've encounter. This can be 
>> easily solved by providing the dtype as a function parameter.
>>     
> Thanks to you too, Jean-Pascal.
>
> But I still have an issue I have just posted, with nansum.
>
>
> Cheers,
>
>   
The issue is the numerical precision (as indicated) and algorithm. See 
also the  Numpy-discussion thread 'calculating the mean and variance of 
a large float vector' 
(http://projects.scipy.org/pipermail/numpy-discussion/2008-June/034766.html).

Perhaps there is a case to promote everything to float128.

Bruce


More information about the SciPy-user mailing list