Re:Widely useful Python utilities by Peter Norvig
by yummyfajitas on Monday September 14, 2009 @03:40PM
(#822443)
A useful utility I've rarely seen included in such a list is inverse_image(collection, function) which computes the inverse image of the function restricted to the collection.
A simple example:
Then students_by_gender["A"] contains a list of all the A students (and so on).