[Numpy-discussion] ufunc oddities
Sat May 24 22:18:18 CDT 2008
On Sat, May 24, 2008 at 10:12 PM, Charles R Harris
> On Sat, May 24, 2008 at 9:06 PM, Robert Kern <firstname.lastname@example.org> wrote:
>> On Sat, May 24, 2008 at 10:02 PM, Charles R Harris
>> <email@example.com> wrote:
>> > So what about the rule that the array type takes precedence over the
>> > scalar
>> > type? That is broken for booleans.
>> Yes, and if it wasn't an intentional special case (I don't recall
>> discussing it on the list, but it might have been), then it's a bug
>> and suitable for changing. The other behaviors are intentional and
>> thus not suitable for changing.
> So how do we know which is which? How does one write a test for an
> unspecified behavior? And it is clear that add.reduce breaks the rules for
It breaks it for every integer type, in fact.
In : add.reduce(array(*257, dtype=uint8))
I thought we only did the accumulator-dtype changing for the .sum()
method, but I was wrong.
"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