<div dir="ltr">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.<div>

<br></div><div>Ray Jones</div><div><br><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Oct 27, 2013 at 6:41 PM, Freddie Witherden <span dir="ltr"><<a href="mailto:freddie@witherden.org" target="_blank">freddie@witherden.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 27/10/13 21:05, Jonathan March wrote:<br>
> If an "almost always works" solution is good enough, then sort on the<br>
> distance to some fixed random point that is in the vicinity of your N<br>
> points.<br>
<br>
</div>I had considered this.  Unfortunately I need a solution which really<br>
does always work.<br>
<br>
The only pure-Python solution I can envision -- at the moment anyway --<br>
is to do some cleverness with the output of np.unique to identify<br>
similar values and replace them with an arbitrarily chosen one.  This<br>
should permit the output to be passed to np.lexsort without issue.<br>
<br>
Regards, Freddie.<br>
<br>
<br>
<br>
<br>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div>