Constructing Lists

The Wolfram Language provides powerful functions for constructing lists of any size and structure.

(RefLink[Range, paclet:ref/Range]) — form a list from a range of numbers or other objects {1,2,3,…}

(RefLink[Table, paclet:ref/Table]) — make a table of any dimension of values of an expression

(RefLink[Array, paclet:ref/Array]) — make an array of any dimension by applying a function to successive indices

(RefLink[ConstantArray, paclet:ref/ConstantArray]) — form of a constant array of any dimension

(RefLink[CenterArray, paclet:ref/CenterArray]) — embed an array at the center of another array of any dimension

(RefLink[Subdivide, paclet:ref/Subdivide]) — a list of equal subdivisions of an interval

(RefLink[CoordinateBoundsArray, paclet:ref/CoordinateBoundsArray]), (RefLink[CoordinateBoundingBoxArray, paclet:ref/CoordinateBoundingBoxArray]) — regular grids

(RefLink[SparseArray, paclet:ref/SparseArray]), (RefLink[Normal, paclet:ref/Normal]) — create a list from a sparse array position->value specification

(RefLink[PowerRange, paclet:ref/PowerRange]) — form a list of successive powers in a specified range

(RefLink[Tuples, paclet:ref/Tuples]) — all possible n-tuples from a list

(RefLink[RandomInteger, paclet:ref/RandomInteger]), (RefLink[RandomChoice, paclet:ref/RandomChoice]), (RefLinkPlain[..., paclet:guide/RandomNumberGeneration]) — make lists of random elements

Lists from Iteration

(RefLink[NestList, paclet:ref/NestList]) — create a list by successively iterating a function

(RefLink[Sow, paclet:ref/Sow]), (RefLink[Reap, paclet:ref/Reap]) — create lists of elements "sown" inside programs

(RefLink[IntegerDigits, paclet:ref/IntegerDigits]), (RefLink[RealDigits, paclet:ref/RealDigits]) — make lists from digits in numbers

(RefLink[CoefficientList, paclet:ref/CoefficientList]), (RefLink[CoefficientArrays, paclet:ref/CoefficientArrays]) — make lists from polynomials or equations

(RefLink[Characters, paclet:ref/Characters]) — make a list from the characters in a string

(RefLink[CharacterRange, paclet:ref/CharacterRange]) — a list of a range of characters (e.g. "a" through "z")

(RefLink[ReplaceList, paclet:ref/ReplaceList]) — make a list of possible pattern replacements

Importing Data as Lists