[Numpy-discussion] Robust Sorting of Points

Freddie Witherden freddie at witherden.org
Sun Oct 27 18:41:23 EDT 2013


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.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131027/d3e97ee1/attachment.sig>


More information about the NumPy-Discussion mailing list