Union
Union[list1,list2,…]
gives a sorted list of all the distinct elements that appear in any of the listi.
Union[list]
gives a sorted version of a list, in which all duplicated elements have been dropped.
Details and Options
- If the listi are considered as sets, Union gives their union.
- Union[list1,list2,…] can be input in StandardForm and InputForm as list1⋃list2⋃…. The character ⋃ can be entered as un or \[Union].
- The listi must have the same head, but it need not be List.
- Union[list1,…,SameTest->test] applies test to each pair of elements in the listi to determine whether they should be considered the same.
Examples
open allclose allBasic Examples (3)
Options (4)
Applications (4)
Properties & Relations (2)
Wolfram Research (1988), Union, Wolfram Language function, https://reference.wolfram.com/language/ref/Union.html (updated 1996).
Text
Wolfram Research (1988), Union, Wolfram Language function, https://reference.wolfram.com/language/ref/Union.html (updated 1996).
CMS
Wolfram Language. 1988. "Union." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Union.html.
APA
Wolfram Language. (1988). Union. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Union.html