Best way to add values from keys

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • robinsiebler@gmail.com

    #1

    Best way to add values from keys

    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?

Working...