[Numpy-discussion] New functions.
Robert Kern
robert.kern@gmail....
Wed Jun 1 11:25:59 CDT 2011
On Wed, Jun 1, 2011 at 11:11, Bruce Southey <bsouthey@gmail.com> wrote:
> On 06/01/2011 11:01 AM, Robert Kern wrote:
>> On Wed, Jun 1, 2011 at 10:44, Craig Yoshioka<craigyk@me.com> wrote:
>>> would anyone object to fixing the numpy mean and stdv functions, so that they always used a 64-bit value to track sums, or so that they used a running calculation. That way
>>>
>>> np.mean(np.zeros([4000,4000],'f4')+500)
>>>
>>> would not equal 511.493408?
>> Yes, I object. You can set the accumulator dtype explicitly if you
>> need it: np.mean(arr, dtype=np.float64)
>>
> Sure but fails to address that the output dtype of mean in this case is
> np.float64 which one would naively assume is also np.float64:
> >>> np.mean(np.zeros([4000,4000],'f4')+500).dtype
> dtype('float64')
Of course my statement fails to address that because that wasn't what
I was responding to.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion
mailing list