[Numpy-discussion] sum and mean methods behaviour

Peter Verveer verveer at embl-heidelberg.de
Mon Sep 1 02:35:03 EDT 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()
>>> array([255, 255], Int8).mean()

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
Meyerhofstrasse 1
D-69117 Heidelberg
Tel. : +49 6221 387245
Fax  : +49 6221 387242
Email: Peter.Verveer at embl-heidelberg.de

More information about the NumPy-Discussion mailing list