How to remove duplicate elements in an array? like "list(set(some_array))" in python.

How to remove duplicate elements in an array? like "list(set(some_array))" in python.

g2m.agent
Collaborator Collaborator
408 Views
1 Reply
Message 1 of 2

How to remove duplicate elements in an array? like "list(set(some_array))" in python.

g2m.agent
Collaborator
Collaborator
How to remove duplicate elements in an array?
Like this python code

 

 

t = [1, 2, 3, 1, 2, 3, 4]
list(set(t)) 
# [1, 2, 3, 4]

 

0 Likes
409 Views
1 Reply
Reply (1)
Message 2 of 2

mjcg91
Collaborator
Collaborator

If you don't care about the order of the array, you could use sort_array_and_remove_duplicates from the Rebel-pack.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
0 Likes