How to | Combine and Rearrange Lists

The Wolfram System provides a complete data manipulation language with vast flexibility in rearranging lists with any number of elements in any kind of structure.

Set up a list of six integers with some duplicates (stored as v):

Sort the elements of the list v:

Use Union to sort v and remove any duplicates:

Note that unless you redefine v, it retains its original value:

Redefine v:

Reverse the order of v:

Rotate the elements of v two places to the left:

Rotate the elements of v two places to the right:

Pad v on the left with x to get a list of length 10:

Partition the list v into sublists of length 2:

Partition the list v into sublists of length 2 with offset 1:

Split a list into runs of identical elements:

Flatten deletes inner braces in nested lists:

Join the elements of a set of lists:

  • Combining Lists
  • Rearranging Lists
  • Manipulating Lists by Their Indices
  • Nested Lists
  • Grouping and Combining Elements of Lists
  • Adding, Removing, and Modifying List Elements
  • How to: Work with Lists
  • How to: Do Linear Algebra
  • Sort  Join  Union  Reverse  Split  Partition  Flatten  RotateLeft  RotateRight  PadLeft  PadRight

  • "How to" Topics