我有一份要转换成字典的词典列表。
q2 = [{'ComplainDepartment':'Academic','count':1}, {'ComplainDepartment':'Hostel','count':2}]
更改为:
data = {'Academic':1,'Hostel':2}
python dictionary list
dictionary ×1
list ×1
python ×1