I\'ve got a dict that has a whole bunch of entries. I\'m only interested in a select few of them. Is there an easy way to prune all the other ones out?
Given your original dictionary orig and the set of entries that you're interested in keys:
filtered = dict(zip(keys, [orig[k] for k in keys]))
which isn't as nice as delnan's answer, but should work in every Python version of interest. It is, however, fragile to each element of keys existing in your original dictionary.