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 that are preceded by at least one larger element:

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:

Wolfram Research (2008), DeleteDuplicates, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteDuplicates.html (updated 2014).

Text

Wolfram Research (2008), DeleteDuplicates, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteDuplicates.html (updated 2014).

CMS

Wolfram Language. 2008. "DeleteDuplicates." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/DeleteDuplicates.html.

APA

Wolfram Language. (2008). DeleteDuplicates. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeleteDuplicates.html

BibTeX

@misc{reference.wolfram_2023_deleteduplicates, author="Wolfram Research", title="{DeleteDuplicates}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DeleteDuplicates.html}", note=[Accessed: 24-September-2023 ]}

BibLaTeX

@online{reference.wolfram_2023_deleteduplicates, organization={Wolfram Research}, title={DeleteDuplicates}, year={2014}, url={https://reference.wolfram.com/language/ref/DeleteDuplicates.html}, note=[Accessed: 24-September-2023 ]}