[Numpy-discussion] Binary ufuncs: minimum
Tue May 27 11:14:23 CDT 2008
On Tue, May 27, 2008 at 6:06 PM, Charles R Harris
> On Tue, May 27, 2008 at 9:09 AM, Robert Kern <email@example.com> wrote:
>> On Tue, May 27, 2008 at 2:51 AM, Stéfan van der Walt <firstname.lastname@example.org>
>> > Did this change recently?
>> > In : np.__version__
>> > Out: '1.1.0.dev5211'
>> > In : np.minimum(np.uint8(164), np.uint64(12807)).dtype
>> > Out: 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.
> What generic rules? If you look, you will already find exceptions. And
> should such rules apply to the bitwise operators? The shift operators? What
> are the rules for comparing strings with numbers?
> I put posted these results for comment and review because they will soon be
> made permanent. I also don't think ufuncs should return object arrays in any
> circumstance that doesn't have an object array as part of the input.
What do you expect from:
>>> np.minimum(np.uint8(164), np.uint64(160)).dtype
uint64 I guess, right !?
More information about the Numpy-discussion