sorting 1172026 entries

Benjamin Schollnick benjamin at schollnick.net
Sun May 6 12:07:24 EDT 2012


On May 6, 2012, at 11:57 AM, J. Mwebaze wrote:

> I have several lists with approx 1172026 entries. I have been trying to sort the records, but have failed.. I tried lists.sort() i also trired sorted python's inbuilt method. This has been running for weeks.
> 
> Any one knows of method that can handle such lists. 

The issue there is the sheer size of the list.  I can't think of an algorithium that wouldn't have a problem with a list of that size.

Two suggestions....

1) Is there no other way to organize this data, other than having it in a single list?  You can't organize it by, for example, zip code, area code, year, or something, and make multiple lists?  Reducing the size would speed the sort up.

2) Maybe consider a different storage method, for example, adding the data into a database?  And then connecting to the database via python?

		- Benjamin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120506/466bd595/attachment-0001.html>


More information about the Python-list mailing list