我有这样一个csv文件:
001,citycode,countrycode,usacode,usacountrycode
00457,citycode,countrycode,ugandacode,kampalacode
00976,countrycode,dubaicode,uaecode,dubaiareacode
我怎样才能把这些数据编成这样的字典:
data_dict = {'001' : ['citycode', 'countrycode', 'usacode', 'usacountrycode'],
'00457' : ['citycode', 'countrycode', 'ugandacode', 'kampalacode'],
'00976' : ['countrycode', 'dubaicode', 'uaecode', 'dubaiareacode']}
Python有一个
csv
模块,文档是here。你知道吗相关问题 更多 >
编程相关推荐