[Numpy-discussion] Robust Sorting of Points

Thouis (Ray) Jones thouis at gmail.com
Mon Oct 28 09:41:37 EDT 2013

Always, *always*, or just with high enough probability that you don't
realistically have to worry about it failing.  If the latter, I wonder if
you could do something with random projections.  Off the top of my head, I
wonder if something like the sum of ranks when ordered under a set of
random projection directions might be stable for a large enough set of
directions.  It's been a while since my Randomized Algorithms class, though.

Ray Jones

On Sun, Oct 27, 2013 at 6:41 PM, Freddie Witherden <freddie at witherden.org>wrote:

> On 27/10/13 21:05, Jonathan March wrote:
> > If an "almost always works" solution is good enough, then sort on the
> > distance to some fixed random point that is in the vicinity of your N
> > points.
> I had considered this.  Unfortunately I need a solution which really
> does always work.
> The only pure-Python solution I can envision -- at the moment anyway --
> is to do some cleverness with the output of np.unique to identify
> similar values and replace them with an arbitrarily chosen one.  This
> should permit the output to be passed to np.lexsort without issue.
> Regards, Freddie.
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131028/3a5bc361/attachment.html>

More information about the NumPy-Discussion mailing list