--> -->
 
 
KeyError
Python 3.5.3: /usr/bin/python3
Fri May 7 07:13:11 2021

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /var/www/html/new_releases_by_genre.cgi in ()
    292 data, dindex = loadcsv(datafile, ['genre', 'artist_uri', 'artist', 'region'], {'int': ['rank', 'level', 'genre_rank', 'num_tracks', 'artist_popularity_rank']}, filter=filter, prefilter=prefilter)
    293 genrescores = {}
=>  294 for genre, rows in dindex['genre'].items():
    295     sortedrows = sorted(rows, key=lambda row: row['rank'])
    296     genrescores[genre] = (-sum([1. / (row.get('artist_popularity_rank', 1000000000) + i) for i, row in enumerate(sortedrows)]), -len(rows))
genre undefined, rows undefined, dindex = {}, ].items = <built-in method items of dict object>

KeyError: 'genre'
      args = ('genre',)
      with_traceback = <built-in method with_traceback of KeyError object>