Efficient liner for switching list of dicts to dictionary of lists

前端 未结 0 778
伪装坚强ぢ
伪装坚强ぢ 2020-12-14 22:53

I find myself repeating the following code (or something similar) often:

users = {}
for d in data:
    if d[\'user\'] in users.keys():
        users[d[\'user\         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题