Best way to add values from keys

robinsiebler at gmail.com robinsiebler at gmail.com
Thu Jul 12 16:15:17 EDT 2007


I have a data structure that looks like this:

    dates = {}; last_song = [] #; year = {}; week = {}; date = {};
artist = []; song = {}
#    dates = {'2007': {'25': {'06/23/07': {'aerosmith': [{'sweet
emotion': 1}, {'dream on': 2}],
#                                          'Metallica': [{'Fade to
Black': 1}, {'Master of Puppets': 1}]},
#             'last_song': [Master of Puppets', 'Fade to Black',
'sweet emotion']}}}

What is the most effecient way to go through a week and determine how
many times each song was played?




More information about the Python-list mailing list