Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Select all the elements from a list for which a given function returns the same answer twice or more
ResourceFunction["DuplicatesBy"][list,f] gives back the elements e for which f[e] appears twice or more in list. |
Select all duplicates by their absolute value:
In[1]:= |
Out[1]= |
Select all duplicates by their first element:
In[2]:= |
Out[2]= |
DuplicatesBy is related to the resource function Duplicates:
In[3]:= |
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