May-23-2024, 03:15 PM
(This post was last modified: May-23-2024, 03:15 PM by deanhystad.)
Quote:this weird structure comes from defaultdict btw...Should the first step be to change the way the dictionaries are structured? How would you like them to look? Do you have control of the code that generates the dictionary? If so, post the code with some example data and a description of what you want for output. defaultdict does what it is told to do, so odd dictionary structure is the fault of the code using defaultdict. Solve the real problem instead of putting a band-aid on it.
And can you define what you mean by "duplicate"? Since your dictionary has 1 key and 1 value, and the values in the two dictionaries are different, there are no duplicates.