Subsetting a dictionary

Will Newton will at nospam.misconception.org.uk
Mon Mar 19 13:04:56 EST 2001


Emile van Sebille wrote:

> Rather than copying and then deleting from the copy, try building a new
> dictionary while adding only those that qualify.

On average this makes the code ~10x slower. I haven't done an in depth 
analysis of how the routine is called, but my "backwards" way of doing 
things seems much faster for my task.




More information about the Python-list mailing list