This is documentation for Mathematica 4, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Drop (modified)PadLeft


FilledSmallSquarePartition[list, n] partitions list into non-overlapping sublists of length n.

FilledSmallSquarePartition[list, n, d] generates sublists with offset d.

FilledSmallSquarePartition[list, , , ... ] partitions a nested list into blocks of size .

FilledSmallSquarePartition[list, , , ... , , , ... ] uses offset at level i in list.

FilledSmallSquarePartition[list, n, d, , ] specifies that the first element of list should appear at position in the first sublist, and the last element of list should appear at or after position in the last sublist. If additional elements are needed, Partition fills them in by treating list as cyclic.

FilledSmallSquarePartition[list, n, d, , , x] pads if necessary by repeating the element x.

FilledSmallSquarePartition[list, n, d, , , , , ... ] pads if necessary by cyclically repeating the elements .

FilledSmallSquarePartition[list, n, d, , , ] uses no padding, and so can yield sublists of different lengths.

FilledSmallSquarePartition[list, nlist, dlist, , , padlist] specifies alignments and padding in a nested list.

FilledSmallSquare Example: Partition[a,b,c,d,e,f, 2] LongRightArrow.

FilledSmallSquare All the sublists generated by Partition[list, n, d] are of length n. Some elements at the end of list may therefore not appear in any sublist.

FilledSmallSquare The element e in Partition[a,b,c,d,e, 2] LongRightArrow is dropped.

FilledSmallSquarePartition[a,b,c,d,e, 3, 1] LongRightArrow generates sublists with offset 1.

FilledSmallSquare All elements of list appear in the sublists generated by Partition[list, n, 1].

FilledSmallSquare If d is greater than n in Partition[list, n, d], then elements in the middle of list are skipped.

FilledSmallSquarePartition[list, 1, d] picks out elements in the same way as Take[list, 1, -1, d].

FilledSmallSquarePartition[list, n, d, , ] effectively allows sublists that have overhangs that extend past the beginning or end of list.

FilledSmallSquarePartition[list, n, d, k] is equivalent to Partition[list, n, d, k, k].

FilledSmallSquare Common settings for , are:

FilledSmallSquare Example: Partition[a,b,c,d,2,1,-1,1] LongRightArrow.

FilledSmallSquarePartition[list, n, d, , , padlist] effectively lays down repeated copies of padlist, then superimposes one copy of list on them, and partitions the result.

FilledSmallSquare Common settings for padlist are:

FilledSmallSquare Example: Partition[a,b,c,d,2,1,-1,1,x,y] LongRightArrow.

FilledSmallSquarePartition[a,b,c,d,2,1,-1,1,] LongRightArrow.

FilledSmallSquare If list has length s, then Partition[list, n, d] yields Max[0, Floor[(s + d - n)/d]] sublists.

FilledSmallSquarePartition[list, , , ... , ] effectively replaces blocks of elements at level r in list by depth r nested lists of neighboring elements.

FilledSmallSquare If no offsets are specified, the neighborhoods are adjacent and non-overlapping.

FilledSmallSquarePartition[list, , , ... , d] uses offset d at every level.

FilledSmallSquarePartition[list, nlist, dlist, , , ... , , , ... ] specifies that element 1,1,... of list should appear at position , , ... in the 1,1,... block of the result, while element -1,-1,... of list should appear at or after position , , ... in the -1,-1,... block of the result.

FilledSmallSquare, is taken to be equivalent to , , ... , , , ... .

FilledSmallSquare, , ... is taken to be equivalent to , , ... , , , ... .

FilledSmallSquarePartition[list, , , ... , , klist, padlist] effectively makes a depth r array of copies of padlist, then superimposes list on them, and partitions the result.

FilledSmallSquare If list has dimensions , , ... , then Partition[list, , , ... , ] will have dimensions , , ... , , , , ... , where is given by Floor[/].

FilledSmallSquare The object list need not have head List.

FilledSmallSquarePartition[f[a,b,c,d], 2] LongRightArrow.

FilledSmallSquare See The Mathematica Book: Section 1.8.10.

FilledSmallSquare See also: Flatten, RotateLeft, Split, Take, PadLeft, ListConvolve, CellularAutomaton.

Further Examples

Drop (modified)PadLeft