There is a list with sublists of elements.
How can I remove duplicates from sublists? The structure should be preserved.
Sample-R2020.dyn (5.6 KB)
Hi @NurlanAdsk !
You can refer to this topic :
2 Likes
1 Like
Thanks guys for quick help
result = []
duplicate_items = []
for nested in IN[0]:
unique = []
for item in nested:
if item not in duplicate_items:
unique.append(item)
duplicate_items.append(item)
result.append(unique)
OUT = result
Hi guys!
now, i’m trying for do some thing like that: I have a list with sublists of elements. I want to remove duplicates in sublists with the structure should be preserved.
How can I do it please?
Hi,
Welcome to the forum. Do you mean the structure in the sublist?
Do you want to remove the duplicated values or do you want to replace it with for example a null?