need optimizing help

rabbits77 rabbits77 at bigmailbox.net
Sat Mar 13 13:07:54 EST 2004


I have a dictionary with a very very large(possibly millions) of
key/value pairs.
The key is a tuple that looks like (id,date)
What is the fastest way to get out all of the values that match any
key given that they individual key elements are coming from two
seperate lists?
The approach of
for id in IDS:
    for date in dates:
        data=myDict[(id,date)]

seems to just take too long. Is there a speedier, more pythonic, way
of doing this? Any help speeding this up would be much appreciated!!



More information about the Python-list mailing list