[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' 

Perhaps there is a case to promote everything to float128.


More information about the SciPy-user mailing list