title: Python Dictionary Trouble: Grouping by elements in tuple key
body: <p>so I have a dictionary that looks something like this, with 4 element tuples as keys, and a list of lists as corresponding values. (yay indexing)</p>
  
  <pre><code>{('A002', 'R051', '02-00-00', 'LEXINGTON AVE'): [[datetime.datetime(2015, 6, 20, 0, 0),
                                                    750],
                                                   [datetime.datetime(2015, 6, 21, 0, 0),
                                                    576],
                                                   [datetime.datetime(2015, 6, 22, 0, 0),
                                                    1486],
                                                   [datetime.datetime(2015, 6, 23, 0, 0),
                                                    595],
                                                   [datetime.datetime(2015, 6, 24, 0, 0),
                                                    841],
                                                   [datetime.datetime(2015, 6, 25, 0, 0),
                                                    1072],
                                                   [datetime.datetime(2015, 6, 26, 0, 0),
                                                    1049]],
   ('A002', 'R051', '02-00-01', 'LEXINGTON AVE'): [[datetime.datetime(2015, 6, 20, 0, 0),
                                                    670],
                                                   [datetime.datetime(2015, 6, 21, 0, 0),
                                                    457],
                                                   [datetime.datetime(2015, 6, 22, 0, 0),
                                                    1189],
                                                   [datetime.datetime(2015, 6, 23, 0, 0),
                                                    505],
                                                   [datetime.datetime(2015, 6, 24, 0, 0),
                                                    665],
                                                   [datetime.datetime(2015, 6, 25, 0, 0),
                                                    354],
                                                   [datetime.datetime(2015, 6, 26, 0, 0),
                                                    651]]}
  </code></pre>
  
  <p>I want to modify this dictionary so that I combine values for all keys that have the same 1st, 2nd, and 4th tuple elements. (as the two keys up there do). I would like to combine those two key tuples into one key tuple (so that my combined key is just <code>('A002', 'R051', 'LEXINGTON AVE')</code>) and combine the values as well. Is this possible in python?</p>
  
  <p>So, for instance, the first value would be [datetime.datetime(2015, 6, 20, 0, 0), 1420] ----- which is 670 + 750, in this case</p>
  
  <p>Thanks in advance.</p>