On Tue, Sep 29, 2015 at 11:25 AM, Anne Archibald <archib...@astron.nl>
wrote:

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


I also think NaN should be treated the same way as floating point numbers
(whatever that is). Otherwise it is difficult to remember when nan is
essentially a float dtype or another dtype.
(given that float is the smallest dtype that can hold a nan)

Josef



>
> 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
>
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to