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

Take

Take
gives the first n elements of list.
Take
gives the last n elements of list.
Take
gives elements m through n of list.
Take
gives a nested list in which elements specified by are taken at level i in list.
  • Take uses the standard sequence specification:
Allall elements
Noneno elements
nelements 1 through n
-nlast n elements
{n}element n only
{m,n}elements m through n inclusive
{m,n,s}elements m through n in steps of s
  • Take can be used on an object with any head, not necessarily List.
  • Take effectively extracts a submatrix from list.
Take the first 4 elements from a list:
Take the last 3 elements:
Take elements 2 through 4:
Take the first 4 elements from a list:
In[1]:=
Click for copyable input
Out[1]=
 
Take the last 3 elements:
In[1]:=
Click for copyable input
Out[1]=
 
Take elements 2 through 4:
In[1]:=
Click for copyable input
Out[1]=
Take elements from the second to the second-to-last:
Take every other element:
Take the first two rows of a matrix:
Take all rows, and the first two columns:
Take the first two rows, and the last column:
Take a submatrix:
Take every other row and column:
Take works with any head, not just List:
Take works with SparseArray objects:
Pick out a subimage:
Sample every third cell in an image:
Take and Drop are complementary:
Take is often equivalent to Part extraction with Range:
Take is equivalent to Part extraction with Span:
Take gives an array whose first dimensions are its arguments:
Reverse[e] is equivalent to Take:
Take always returns a list, even if it is just taking a single element:
New in 1 | Last modified in 5