![](https://secure.gravatar.com/avatar/ad13088a623822caf74e635a68a55eae.jpg?s=120&d=mm&r=g)
On Tue, Sep 29, 2015 at 11:25 AM, Anne Archibald <archibald@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 <freddyrietdijk@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.harris@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