添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
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)