Q:

Dict containing keys with lists of lists

I have a dict structured as below:
{ 'records':[['15','2013-04-02','Mexico','blah','bleh',1,2],['25','2013-04-02','Italy','meh','heh',3,4]], 'attributes':['id','date','location','descr1','descr2','total1','total2'] }

It was created from json using json.load.
How can I iterate through the records key as to make ['records'][0] a key in a new dict and the remainder of each list in ['records'] be the value for that key.
Something like this is what I am thinking, may not even be possible, I am new to Python:
{ '15':['2013-04-02','Mexico','blah','bleh',1,2], '25':['2013-04-02','Italy','meh','heh',3,4] }

Could someone point me in the right direction to going about iterating through the original dict to create the new one?

A:

If d is your dictionary:
In [5]: {rec[0]:rec[1:] for rec in d['records']}
Out[5]: 
{'15': ['2013-04-02', 'Mexico', 'blah', 'bleh', 1, 2],
 '25': ['2013-04-02', 'Italy', 'meh', 'heh', 3, 4]}

A:

rec_lsts = orgi_dict['records']
new_dict = {}
for l_list in rec_lsts:
    new_dict[l_lst[0]] = l_lst[1:]

