[Numpy-discussion] ufunc oddities
Sat May 24 22:01:02 CDT 2008
On Sat, May 24, 2008 at 9:57 PM, Charles R Harris
> How about
> In : x += 5
> In : x
> Out: array([ True, True], dtype=bool)
Output = bool.
> In : x.tostring()
> Out: '\x01\x01'
> In : x + 5
> Out: array([6, 6])
Output != bool.
> In : (x + 5).dtype
> Out: dtype('int32')
> In : (x.astype(int8) + 5).dtype
> Out: dtype('int8')
> I have to write tests for 64 of these buggers and some poor sod has to write
> the documentation. All these inconsistencies are going to drive both of us
They aren't inconsistent in the slightest. They follow from a very simple rule.
"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