i need your help. I have 1 list with few sublists. The content of the sublists overlap a little bit.
Now i want to create a new list, with the same sublists but only with unique elements from the whole list. I tried setdifference with various levels, but that didn’t work. Please see my screenshot below.
one solution could be:
In “0 List” are always only unique elements, so i have to compare “1 List” with “0 list” an delete all elements which are the same to “0 list” from “1 List” and so on…
You’re probably going to want to do this in python, especially if your lists are going to vary is size/number. You just need to keep track of an existing list of values that you’ve already included in your sublists. Iterate through each item in each sublist. If that item already exists in you your existing list, skip it. If it’s a new item, keep it in the sublist and then add it to the existing list.