Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Select all the elements that appear twice or more in a list
ResourceFunction["Duplicates"][list] gives back the elements that appear twice or more in list. |
Only the repeated elements (1 and 2) are returned:
In[1]:= |
Out[1]= |
Duplicates looks at elements at level 1:
In[2]:= |
Out[2]= |
Duplicates gives all the copies of the repeated elements:
In[3]:= |
Out[3]= |
Use the resource function DuplicatesList to get the unique elements:
In[4]:= |
Out[4]= |
An empty list is returned if there are no duplicates:
In[5]:= |
Out[5]= |
This work is licensed under a Creative Commons Attribution 4.0 International License