Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save serbaniuliuscezar/fda76324f3b8089f26670ed723b7dd5e to your computer and use it in GitHub Desktop.
Save serbaniuliuscezar/fda76324f3b8089f26670ed723b7dd5e to your computer and use it in GitHub Desktop.
Python common dicts
set_list1 = set(tuple(sorted(d.items())) for d in all_info[0])
set_list2 = set(tuple(sorted(d.items())) for d in all_info[1])
set_overlap = set_list1.intersection(set_list2)
for tuple_element in set_overlap:
test.append(dict((x, y) for x, y in tuple_element))
set_difference = set_list1.difference(set_list2)
for tuple_element in set_difference:
test2.append(dict((x, y) for x, y in tuple_element))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment