Created
November 13, 2019 09:16
-
-
Save serbaniuliuscezar/fda76324f3b8089f26670ed723b7dd5e to your computer and use it in GitHub Desktop.
Python common dicts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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