添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
斯文的杯子  ·  Python+Django 核心介绍 - ...·  3 月前    · 
愤怒的风衣  ·  Python 异步 ASGI ...·  3 月前    · 
奔跑的骆驼  ·  结合使用 Oracle Database ...·  3 月前    · 
稳重的核桃  ·  Java SE 8u381 ...·  2 年前    · 
干练的西装  ·  Eclipse ...·  3 年前    · 
edata = [{"resource_id": "test", "operation_status": "change"},
{"resource_id": "test", "operation_status": "create"},
{"resource_id": "test1","operation_status": "change"},
{"resource_id": "test1","operation_status": "delete"}]
new_s = [] # 存储去重后的数据
for x in edata: # 根据字典列表的resource_id做去重操作
if any(str(d.get('resource_id', None)).lower() == str(x['resource_id']).lower() for d in new_s):
pass
else:
new_s.append(x)
print(new_s)