Reputation: 2350
I have a csv file like this:
001,citycode,countrycode,usacode,usacountrycode
00457,citycode,countrycode,ugandacode,kampalacode
00976,countrycode,dubaicode,uaecode,dubaiareacode
How can I make a dictionary of this data like this:
data_dict = {'001' : ['citycode', 'countrycode', 'usacode', 'usacountrycode'],
'00457' : ['citycode', 'countrycode', 'ugandacode', 'kampalacode'],
'00976' : ['countrycode', 'dubaicode', 'uaecode', 'dubaiareacode']}
Upvotes: 0
Views: 115