我有下列词典:
d = [
{ 'name': 'test', 'regions': [{'country': 'UK'}] },
{ 'name': 'test', 'regions': [{'country': 'US'}, {'country': 'DE'}] },
{ 'name': 'test 1', 'regions': [{'country': 'UK'}], 'clients': ['1', '2', '5'] },
{ 'name': 'test', 'regions': [{'country': 'UK'}] },
]
从列表中删除重复项的最简单方法是什么?
我看到了有效的解决方案,但前提是项目没有嵌套的dict或list
这个怎么样:
对于“易于实现”中最简单的一个来说,this question中的那个看起来非常紧凑。
不过,这也不太可能是非常有效的性能。
相关问题 更多 >
编程相关推荐