[Numpy-discussion] sum and mean methods behaviour

Peter Verveer verveer at embl-heidelberg.de
Mon Sep 1 02:35:03 CDT 2003


Hi All,

I noticed that the sum() and mean() methods of numarrays use the precision of 
the given array in their calculations. That leads to resuls like this:

>>> array([255, 255], Int8).sum()
-2
>>> array([255, 255], Int8).mean()
-1.0

Would it not be better to use double precision internally and return the 
correct result?

Cheers, Peter

-- 
Dr. Peter J. Verveer
Cell Biology and Cell Biophysics Programme
EMBL
Meyerhofstrasse 1
D-69117 Heidelberg
Germany
Tel. : +49 6221 387245
Fax  : +49 6221 387242
Email: Peter.Verveer at embl-heidelberg.de






More information about the Numpy-discussion mailing list