On Mo, 2015-08-31 at 10:23 -0700, Stephan Hoyer wrote: > On Mon, Aug 31, 2015 at 1:23 AM, Sebastian Berg > <sebast...@sipsolutions.net> wrote: > That would be my gut feeling as well. Returning `NaN` could > also make > > sense, but I guess we run into problems since we do not know > the input > type. So `None` seems like the only option here I can think of > right > now. > > > My inclination is that return NaN would be the appropriate choice. > It's certainly consistent with the behavior for float dtypes -- my > expectation for object dtype behavior is that it works exactly like > applying the np.sign ufunc to each element of the array individually. >
I was wondering a bit if returning the original object could make sense. It would work for NaN (and also decimal versions of NaN, etc.). But I am not sure in general. - Sebastian > > On the other hand, I suppose there are other ways in which an object > can fail all those comparisons (e.g., NaT?), so I suppose we could > return None. But it would still be a weird outcome for the most common > case. Ideally, I suppose, np.sign would return an array with int-NA > dtype, but that's a whole different can of worms... > > > Stephan > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion
signature.asc
Description: This is a digitally signed message part
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion