PRODUCTS
Mathematica
Mathematica for Students
Mathematica for the Classroom
grid
Mathematica
web
Mathematica
Mathematica Player
(free download)
Mathematica Player Pro
Wolfram
Workbench
Mathematica
Applications
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
FOR USERS
All User Resources
Product Registration
Technical Support
Customer Service
Developer Support
Does My Site Have a License?
Free Seminars
Certified Training
Custom Group Seminars
Documentation & Examples
Tutorial Screencasts
Video Gallery
Demonstrations Project
Education Portal
Student Resources
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Wolfram Blog
Mathematica Journal
Wolfram Library Archive
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
Mathematica
>
Core Language
>
List Manipulation
>
Rearranging & Restructuring Lists
>
Mathematica
>
Data Manipulation
>
Handling Arrays of Data
>
Rearranging & Restructuring Lists
>
Built-in
Mathematica
Symbol
Combining Lists
Lists as Sets
Tutorials »
|
Join
Intersection
Complement
Tally
DeleteDuplicates
BinLists
Split
Or
BitOr
See Also »
|
Exploratory Data Analysis
Discrete & Integer Data
Discrete Mathematics
Handling Arrays of Data
Math & Counting Operations on Lists
Numerical Data
Rearranging & Restructuring Lists
More About »
Union
(
)
Union
[
list
1
,
list
2
,
...
]
gives a sorted list of all the distinct elements that appear in any of the
list
i
.
Union
[
list
]
gives a sorted version of a list, in which all duplicated elements have been dropped.
MORE INFORMATION
If the
list
i
are considered as sets,
Union
gives their union.
Union
[
list
1
,
list
2
,
...
]
can be input in
StandardForm
and
InputForm
as
list
1
list
2
...
. The character
can be entered as
Esc
un
Esc
or
\[Union]
.
The
list
i
must have the same head, but it need not be
List
.
Union
[
list
1
,
...
,
SameTest
->
test
]
applies
test
to each pair of elements in the
list
i
to determine whether they should be considered the same.
EXAMPLES
CLOSE ALL
Basic Examples
(3)
Give a sorted list of distinct elements:
In[1]:=
Out[1]=
Give a sorted list of distinct elements from all the lists:
In[1]:=
Out[1]=
Enter using
Esc
un
Esc
:
In[1]:=
Out[1]=
Scope
(1)
Generalizations & Extensions
(1)
Options
(4)
Applications
(4)
Properties & Relations
(2)
Possible Issues
(1)
SEE ALSO
Join
Intersection
Complement
Tally
DeleteDuplicates
BinLists
Split
Or
BitOr
TUTORIALS
Combining Lists
Lists as Sets
MORE ABOUT
Exploratory Data Analysis
Discrete & Integer Data
Discrete Mathematics
Handling Arrays of Data
Math & Counting Operations on Lists
Numerical Data
Rearranging & Restructuring Lists
RELATED LINKS
NKS|Online
(
A New Kind of Science
)
New in 1 | Last modified in 3
© 2008 Wolfram Research, Inc.