DeleteDuplicates

DeleteDuplicates[list]

deletes all duplicates from list.

DeleteDuplicates[list,test]

applies test to pairs of elements to determine whether they should be considered duplicates.

Details

Examples

open allclose all

Basic Examples  (2)

Delete duplicated elements:

Delete elements whose values duplicate those earlier in the association:

Scope  (1)

Delete elements unless they are larger than ones that came before:

Properties & Relations  (2)

DeleteDuplicates is similar to Union without sorting:

Avoiding the sort improves the speed substantially:

Delete sublists that have the same total:

DeleteDuplicatesBy can be used to achieve the same result:

Introduced in 2008
 (7.0)
 |
Updated in 2014
 (10.0)