我有一本这样的字典:
d = {'Date' : ['2013-05-01', '2013-05-01', '2013-05-01', '2013-05-01'],
'Country Code' : ['93', '92', '91', '90'],
'Area Code' : ['1,2,3,4,5,6,7', '31,32,43,44,54,56,7, ', '434,34,4', '00, 89']}
我想要这样的字典:
d = {'Date' : ['2013-05-01', '2013-05-01', '2013-05-01', '2013-05-01'],
'Combined Code' : ['931,932,933,934,935,936,937', '9231,9232,9243,9244,9254,9256,927,92 ,', '91434,9134,914', '9000, 9089']}
我尝试过的是:
list(chain(*(product(*(s.split(",") for s in e)) for e in zip(*d.values()))))
但无法在字典中管理这一切。