我在Python以下數據集:Python字典數據操縱
數據= [{ 'ID': '431876400186007 /見解/ page_fans_country /壽命', '名稱': 'page_fans_country', '描述' :'終身:按照國家排序的Facebook位置數據彙總,關於喜歡你的頁面的人。 (獨特用戶)','標題':'終身喜歡國家','期限':'終生','價值觀':[{'end_time':'2016-07-02T07:00:00 + 0000','值'':{'PK':100,'AT':151,'SK':81,'RO':488,'BE':367,'ID':91'MX':82'GB': 2063,CY:1820,TN:92,NL,418,ES,230,RU,99,CZ, 'PH':144,'AU':550,'GE':178,'GR':273321,'CO':98,'DZ':86,'US':2447,'BG':732''MA '':95,'MK':831,'PT':160,'CH':187,'CA':317,'DE':4463,'AL':1588,'FR':388,'PE': 204,'AE':142,'TR':547,'BR':609,'SE':495,'HU':120,'IT':845,'PL':186,'IN' 'EG':217,'NO':97,'DK':77,'RS':444}},{'end_time':'2016-07-03T07:00:00 + 0000','value':{ 'PK':100,'AT':151,'SK':81,'RO':488,'BE':367,'ID':91,'MX':82,'GB':2063,'CY ':1820,'TN':92,'NL':418,'ES':230,'RU':99,'CZ':188,'AR':105,'BD':80,'PH': 144,'AU':548,'GE':178,'GR':273275,'CO':98,'DZ':86,'US':2447,'BG':732,'MA':95, 'MK':831,'PT':159,'CH':187,'CA':317, 'DE':4462,'AL':1588,'FR':388,'PE':204,'AE':142,'TR':547,'BR':607,'SE':495,'HU ':120,'IT':845,'PL':186,'IN':114,'EG':217,'NO':97,'DK':77,'RS':445}},{' end_time':'2016-07-04T07:00:00 + 0000','value':{'PK':100,'AT':151,'SK':81,'RO':488,'BE': 367'ID'90'MX'82'GB'2063 CY'1820 TN'92'NL'418 ES'230 RU' 'CZ':188,'AR':105,'BD':80,'PH':144,'AU':547,'GE':178,'GR':273249,'CO':98''DZ ':86,'US':2445,'BG':732,'MA':95,'MK':831,'PT':159,'CH':187''CA':317'DE': 4460'AL'1588 FR'388'PE'204'AE'142'TR'547 BR' 'IT':845,'PL':186,'IN':114,'EG':217,'NO':97,'DK':77,'RS':444}}]}]
我想用這樣的國家數據做一本詞典:
{'PK': 100,
'AT': 151,
'SK': 81,
'RO': 488,
'BE': 367,
'ID': 91,
'MX': 82,
'GB': 2063,
'CY': 1820,
'TN': 92,
'NL': 418,
'ES': 230,
'RU': 99,
'CZ': 188,
'AR': 105,
'BD': 80,
'PH': 144,
'AU': 550,
'GE': 178,
'GR': 273321,
'CO': 98}
我該怎麼辦?因爲我可以在一個普通的字典
data['value']
:
我不能使用下面的代碼。
請編輯你的問題,並告訴我們你已經嘗試過,添加你的代碼。就目前來看,這個問題似乎更像是一個代碼請求。 – CentAu