Hi, is there a way to combine these keys?
Can be done with out of the box nodes as well.
- A Dictionary.Keys node to get all the keys from each dictionary.
- A Dictionary.ValueAtKey node to get the value associated with each key in the dictionary.
- Two List.Flatten nodes to remove the extra list structure.
- And a Dictionary.ByKeysValues node to build the combined dictionary.
Things get more difficult when each key isnβt unique, but if you want to append to the list that can be solved by using a List.GroupByKey node and another flatten node with proper lacing and list levels on both.
2 Likes
And python
OUT = {k: v for d in IN[0] for k, v in d.items()}
OUT = dict()
[OUT.update(d) for d in IN[0]]
4 Likes