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

Sebastian Haase haase at msg.ucsf.edu
Wed Sep 20 00:53:16 EDT 2006


Robert Kern wrote:
> Sebastian Haase wrote:
>> I know that having too much knowledge of the details often makes one 
>> forget what the "newcomers" will do and expect.
> 
> Please be more careful with such accusations. Repeated frequently, they can 
> become quite insulting.
> 
I did not mean to insult anyone - what I meant was, that I'm for numpy 
becoming an easy platform to use. I have spend and enjoyed part the last 
four years developing and evangelizing Python as an alternative to 
Matlab and C/Fortran based image analysis environment. I often find 
myself arguing for good support of the single precision data format. So 
I find it actually somewhat ironic to see myself arguing now for wanting 
float64 over float32 ;-)


>> We are only talking 
>> about people that will a) work with single-precision data (e.g. large 
>> scale-image analysis) and who b) will tend to "just use the default" 
>> (dtype)  --- How else can I say this: these people will just assume that 
>> arr.mean() *is* the mean of arr.
> 
> I don't understand what you mean, here. arr.mean() is almost never *the* mean of 
> arr. Double precision can't fix that.
> 
This was not supposed to be a scientific statement -- I'm (again) 
thinking of our students that not always appreciate the full complexity 
of computational numerics and data types and such.
The best I can hope for is a "sound" default for most (practical) cases...
I still think that 80bit vs. 128bit vs 96bit is rather academic for most 
people ...  most people seem to only use float64 and then there are some 
that use float32 (like us) ...


Cheers,
Sebastian




More information about the NumPy-Discussion mailing list