| | |
how to handle large lists?
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: May 2008
Posts: 1
Reputation:
Solved Threads: 0
While executing programs with large lists ,i am encountering an error message:
Index error:List index out of range
The program works well with small lists..Can anyone suggest me some efficient methods to handle this problem?or Is there any other efficient datastructure other than lists and dictionary to serve the purpose ?
Index error:List index out of range
The program works well with small lists..Can anyone suggest me some efficient methods to handle this problem?or Is there any other efficient datastructure other than lists and dictionary to serve the purpose ?
I don't think it has much to do with the size of the list, you are simply going past the number of indexed elements. Look at this example:
python Syntax (Toggle Plain Text)
my_list = [1, 2, 3, 4] print my_list[4] # IndexError: list index out of range
drink her pretty
•
•
Join Date: Dec 2006
Posts: 1,028
Reputation:
Solved Threads: 289
"list index out of range" has nothing to do with the size of the list AFAIK. If the list were too large there would be some sort of out of memory message. SQLite can be used in memory but you'll have to provide some more info on how many records you want to store, what is the size of each record, and what you want to do in order to be more specific.
•
•
•
•
Is there any other efficient datastructure other than lists and dictionary to serve the purpose ?
![]() |
Similar Threads
- Winsock Multi-Client Servers (C++)
- Firefox Compatibility help with script (JavaScript / DHTML / AJAX)
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Open In New Window Php (PHP)
- Beginning Perl (Perl)
Other Threads in the Python Forum
- Previous Thread: Inserting rows in Excel
- Next Thread: Writing arrays to a column of a spreadsheet?
| Thread Tools | Search this Thread |
address anydbm app beginner changecolor cipher class conversion coordinates corners curves definedlines development dictionary dynamic events examples excel feet file float format ftp function generator getvalue gui handling homework images import input ip java keycontrol line linux list lists loan loop maintain matching maze millimeter mouse mysqldb number numbers output parsing path permissions port prime programming projects py2exe pygame pymailer python queue random rational raw_input recursion recursive scrolledtext searchingfile shebang slicenotation split string strings table terminal text thread threading time tkinter tlapse tooltip tuple tutorial type ubuntu unicode url urllib urllib2 valueerror variable variables vigenere web windows wx.wizard wxpython xlwt






