data structures - Filtering / iterating through very large lists in python -
if have list 10 million objects, how filter list quickly. takes 4-5 seconds complete iteration thru list comprehension. there efficient data structures or libraries in python? or python not suited large sets of data?
itertools designed efficient looping. particularly, might find ifilter
suits purpose. iterating through large data structures expensive, if need of data @ time lazy evaluation can lot.
you can try using generator expressions, identical list comprehension counterparts (though usage can different) or generator, have benefits of lazy evaluation.
Comments
Post a Comment