Mathematica > Core Language > List Manipulation > Rearranging & Restructuring Lists > DeleteDuplicates >
Mathematica > Data Manipulation > Handling Arrays of Data > Rearranging & Restructuring Lists > DeleteDuplicates >
Mathematica > Data Manipulation > Image Processing & Analysis > Basic Image Manipulation > Handling Arrays of Data > Rearranging & Restructuring Lists > DeleteDuplicates >

DeleteDuplicates

DeleteDuplicates[list]
deletes all duplicates from list.
DeleteDuplicates
applies test to pairs of elements to determine whether they should be considered duplicates.
  • DeleteDuplicates[list] deletes all but the first occurrence of each distinct element that appears in list.
Delete duplicated elements:
Delete duplicated elements:
In[1]:=
Click for copyable input
Out[1]=
Delete sublists that have the same total:
DeleteDuplicates is similar to Union without sorting:
Avoiding the sort improves the speed substantially:
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF