Re: dictionary with tuple keys

2009-12-15 Thread Brandon Devine
So grateful! Thanks to all. The breadth of Python continues to amaze me, as does your generosity. ("Relative clarity like relative beauty is in the eye of the beholder, and few parents have ugly children"... fantastic!) Brandon -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary with tuple keys

2009-12-15 Thread John Machin
Ben Finney benfinney.id.au> writes: > In this case, I'll use ‘itertools.groupby’ to make a new sequence of > keys and values, and then extract the keys and values actually wanted. Ah, yes, Zawinski revisited ... itertools.groupby is the new regex :-) > Certainly it might be clearer if written

Re: dictionary with tuple keys

2009-12-14 Thread Paul Rubin
Brandon Devine writes: > I am probably not thinking straight anymore about this problem. I > have a dictionary with tuple keys in the format (a, b, A, B) and float > values. I want to collect all the keys with identical (a, b...), > disregarding whatever (... A, B) might be. Spe

Re: dictionary with tuple keys

2009-12-14 Thread Ben Finney
Brandon Devine writes: > I am probably not thinking straight anymore about this problem. I have > a dictionary with tuple keys in the format (a, b, A, B) and float > values. I want to collect all the keys with identical (a, b...), > disregarding whatever (... A, B) might be. Specific

Re: dictionary with tuple keys

2009-12-14 Thread Chris Rebert
On Mon, Dec 14, 2009 at 9:49 PM, Brandon Devine wrote: > Hi all, > > I am probably not thinking straight anymore about this problem.  I > have a dictionary with tuple keys in the format (a, b, A, B) and float > values.  I want to collect all the keys with identical (a, b...),

dictionary with tuple keys

2009-12-14 Thread Brandon Devine
Hi all, I am probably not thinking straight anymore about this problem. I have a dictionary with tuple keys in the format (a, b, A, B) and float values. I want to collect all the keys with identical (a, b...), disregarding whatever (... A, B) might be. Specifically, I want to sum the float