nans and sort orders.
Hi All, I've changed the sort routines so that they sort nans to the end. The sort order is now Real types: [R, nan] Complex types: [R + Rj, R + nanj, nan + Rj, nan + nanj] Where R stands for the usual extended range of reals, i.e. [-inf, finite, +inf] and when two complex numbers have the same pattern of nans then they are sorted on the non-nan part, if any. So the sorts now work with nans but that implies some other fixups on which I would like some feedback. 1) Search sorted -- Search sorted depends on the compare function of the ndarray, I think that compare function should be changed to correspond to the sort order. 2) Methods argmax/argmin/ -- should be compatible with max/min 3) max/min ufuncs -- Problematic, min would fail to propagate nans, should probably stay the same. 4) fmax/fmin ufuncs -- Should stay with c definition 5) Logical comparison ufuncs -- I think these should remain compatible with the c operators. Note that there is a mix of implementations, max/min on void types use the type comparison functions for instance. In other words, changing the type comparisons could mean rewriting some of the other functions. Thoughts? Chuck
participants (1)
-
Charles R Harris