|
SOLUTIONS
|
-
Functions
- Append
- AppendTo
- ArrayFlatten
- ArrayPad
- ArrayReshape
- Complement
- DeleteDuplicates
- Drop
- Flatten
- FlattenAt
- Gather
- GatherBy
- Intersection
- Join
- PadLeft
- PadRight
- Partition
- Permutations
- RandomSample
- ReplacePart
- Reverse
- Riffle
- RotateLeft
- RotateRight
- Sequence
- Sort
- SortBy
- Split
- SplitBy
- Subsets
- Take
- Tally
- Transpose
- Tuples
- Union
- Related Guides
- Tutorials
Rearranging & Restructuring Lists
Mathematica encapsulates in a small number of functions vast flexibility in rearranging lists with any structure and any number of elements.
ReferenceReference
Flatten — flatten out any sequence of levels in a nested list
Partition — partition lists or nested lists into sublists
Join — join lists together at any level
ArrayFlatten ▪ ArrayReshape ▪ FlattenAt ▪ Sequence
Sort — sort lexicographically or with any comparison function
SortBy — sort by the values of a function applied to elements
Reverse — reverse a list at any level
RotateLeft, RotateRight — cyclically rotate lists at any depth
Transpose — transpose any collection of levels
ArrayPad — add padding on each side
Riffle — intersperse additional elements
PadLeft, PadRight — pad lists to be a particular length at any depth
Split — split into runs of identical elements
Gather — gather sublists of identical elements
Union, Tally — enumerate, tally all distinct elements in a list
DeleteDuplicates — delete duplicate elements in a list
Tuples ▪ Subsets ▪ Permutations ▪ RandomSample
SplitBy, GatherBy — split, gather based on values of a function applied to elements
Union ▪ Intersection ▪ Complement
Element-Oriented Operations »
ReplacePart ▪ Take ▪ Drop ▪ Append ▪ AppendTo
