[Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.
josef.pktd at gmail.com
josef.pktd at gmail.com
Wed Oct 2 12:56:19 EDT 2013
On Wed, Oct 2, 2013 at 12:37 PM, Stéfan van der Walt <stefan at sun.ac.za> wrote:
> On 2 Oct 2013 18:04, "Charles R Harris" <charlesr.harris at gmail.com> wrote:
>>
>> The question is what to do when all-nan slices are encountered in the
>> nan{max,min} and nanarg{max, min} functions. Currently in 1.8.0, the first
>> returns nan and raises a warning, the second returns intp.min and raises a
>> warning. It is proposed that the nanarg{max, min} functions, and possibly
>> the nan{max, min} also, raise an error instead.
>
> I agree with Nathan; this sounds like more reasonable behaviour to me.
If I understand what you are proposing
-1 on raising an error with nan{max, min},
an empty array is empty in all columns
an array with nans, might be empty in only some columns.
as far as I understand, nan{max, min} only make sense with arrays that
can hold a nan, so we can return nans.
If a user calls with ints or bool, then there are either no nans or
the array is empty, and I don't care.
---
aside
with nanarg{max, min} I would just return 0 in an all nan column,
since the max or min is nan, and one is at zero.
(but I'm not arguing)
Josef
>
> Stéfan
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
More information about the NumPy-Discussion
mailing list