IEEE 754 has signum(NaN)->NaN. So does np.sign on floating-point arrays.
Why should it be different for object arrays?

Anne

P.S. If you want exceptions when NaNs appear, that's what np.seterr is for.
-A

On Tue, Sep 29, 2015 at 5:18 PM Freddy Rietdijk <freddyrietd...@fridh.nl>
wrote:

> I wouldn't know of any valid output when applying the sign function to
> NaN. Therefore, I think it is correct to return a ValueError. Furthermore,
> I would prefer such an error over just returning NaN since it helps you
> locating where NaN is generated.
>
> On Tue, Sep 29, 2015 at 5:13 PM, Charles R Harris <
> charlesr.har...@gmail.com> wrote:
>
>> Hi All,
>>
>> Due to a recent commit, Numpy master now raises an error when applying
>> the sign function to an object array containing NaN. Other options may be
>> preferable, returning NaN for instance, so I would like to open the topic
>> for discussion on the list.
>>
>> Thoughts?
>>
>> Chuck
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to