[Numpy-discussion] Binary ufuncs: minimum

Robert Kern robert.kern@gmail....
Tue May 27 10:09:41 CDT 2008


On Tue, May 27, 2008 at 2:51 AM, Stéfan van der Walt <stefan@sun.ac.za> wrote:
> Did this change recently?
>
> In [33]: np.__version__
> Out[33]: '1.1.0.dev5211'
>
> In [34]: np.minimum(np.uint8(164), np.uint64(12807)).dtype
> Out[34]: dtype('uint64')
>
> But yes, that looks like it should return a uint8.

While it is possible for the result to fit into uint8, that would
break the generic ufunc casting rules.

-- 
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