TakeList[list,{n1,n2,…}]
gives the list of results obtained by successively taking ni elements from list.
TakeList[list,{seq1,seq2,…}]
successively uses the sequence specifications seqi.
TakeList[list,seqs1,seqs2,…]
gives a nested list in which elements specified by the lists seqsi are taken at level i in list.
TakeList
TakeList[list,{n1,n2,…}]
gives the list of results obtained by successively taking ni elements from list.
TakeList[list,{seq1,seq2,…}]
successively uses the sequence specifications seqi.
TakeList[list,seqs1,seqs2,…]
gives a nested list in which elements specified by the lists seqsi are taken at level i in list.
Examples
open all close allBasic Examples (5)
Take sublists of different lengths from a list of symbols:
TakeList[{a, b, c, d, e, f, g, h}, {2, 3, 1}]TakeList[{a, b, c, d, e, f, g, h}, {-2, -3, -1}]Take two elements, then three elements, and then all the rest:
TakeList[Alphabet[], {2, 3, All}]Take two elements, then three elements, and then up to 10 and five if present:
TakeList[Range[12], {2, 3, UpTo[10], UpTo[5]}]Take a list of subexpressions from an expression with any head:
TakeList[h[a, b, c, d, e, f, g], {2, 3, 1}]Scope (2)
Take sublists using different sequence specifications:
TakeList[Alphabet[], {3, {1, 9, 3}, -4}]Take subblocks of different sizes from a matrix:
MatrixForm[matrix = Array[Subscript[x, ##]&, {6, 6}]]TakeList[matrix, {2, 3}, {3, 2}]MatrixForm[Map[MatrixForm, %, {2}]]Properties & Relations (5)
TakeList[list,seqs] is equivalent to FoldPairList[TakeDrop,list,seqs]:
list = Alphabet[]TakeList[list, {2, 5, 4, 3}]FoldPairList[TakeDrop, list, {2, 5, 4, 3}]TakeList[list,{n,…,n}] is equivalent to Partition[list,n] for an appropriate number of take specifications:
list = Alphabet[]TakeList[list, {6, 6, 6, 6}] === Partition[list, 6]Floor[Length[list] / 6]The equivalent of Partition[list,UpTo[n]] may require an additional take specification:
TakeList[list, {6, 6, 6, 6, 2}] === Partition[list, UpTo[6]]{Length[list], Total[{6, 6, 6, 6, 2}]}Subdivide a list in sublists of different lengths using TakeList:
list = Range[10]TakeList[list, {4, 2, 3, 1}]The original list can be reconstructed using Flatten:
Flatten[%] === listSubdivide an array in blocks of different sizes using TakeList:
matrix = Array[Subscript[x, ##]&, {6, 6}]TakeList[matrix, {4, 2}, {3, 2, 1}]The original matrix can be reconstructed with ArrayFlatten:
ArrayFlatten[%] === matrixTake a list of expressions with the same head and any lengths:
list = {head[a, b, c], head[d, e], head[f, g, h, i, j]};lengths = Length /@ listJoin those expressions into a single expression with the common head:
Apply[Join, list]The original list can be reconstructed with TakeList by giving the lengths of the subexpressions:
TakeList[%, lengths] === listSee Also
Take Drop TakeDrop Partition UpTo Part Extract FoldPairList NumberDecompose
Related Guides
History
Text
Wolfram Research (2017), TakeList, Wolfram Language function, https://reference.wolfram.com/language/ref/TakeList.html.
CMS
Wolfram Language. 2017. "TakeList." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TakeList.html.
APA
Wolfram Language. (2017). TakeList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TakeList.html
BibTeX
@misc{reference.wolfram_2026_takelist, author="Wolfram Research", title="{TakeList}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/TakeList.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_takelist, organization={Wolfram Research}, title={TakeList}, year={2017}, url={https://reference.wolfram.com/language/ref/TakeList.html}, note=[Accessed: 12-June-2026]}