[Tutor] Sorting large numbers of co-ordinate pairs

Dinesh B Vadhia dineshbvadhia at hotmail.com
Thu Mar 12 14:43:49 CET 2009


Have a large number (> 1bn) of integer co-ordinates (i, j).  The i are ordered and the j unordered.

I want to create (j, i) with j ordered and i unordered ie.

from:

...
6940, 22886
6940, 38277
6940, 43788
...

to:
...
38277, 567
38277, 90023
38277, 6940
...

I've tried the dictionary route and it works perfectly for small set of co-ordinate pairs but not for large sets as it hits memory capacity.

Any ideas how I could do this?

Dinesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090312/ccca51b4/attachment.htm>


More information about the Tutor mailing list