PRODUCTS
Products Overview
Mathematica
Mathematica for Students
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
SUPPORT
Support Overview
Knowledge Base
Learning Center
Community & Forums
Training & Free Seminars
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
Mathematica
>
Core Language
>
Expressions
>
Parts of Expressions
>
Take
>
BUILT-IN MATHEMATICA SYMBOL
Getting Pieces of Lists
Manipulating Lists by Their Indices
Tutorials »
|
Span
Part
Drop
StringTake
First
Last
Most
Rest
Complement
Select
Cases
TakeWhile
See Also »
|
Basic Image Manipulation
Elements of Lists
Handling Arrays of Data
Language Overview
List Manipulation
Numerical Data
Parts of Expressions
Parts of Matrices
Rearranging & Restructuring Lists
Structural Operations on Expressions
More About »
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
.
MORE INFORMATION
Take
uses the standard sequence specification:
All
all elements
None
no elements
n
elements 1 through
n
-
n
last
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
.
Applying
Take
to a
SparseArray
object normally yields another
SparseArray
object.
EXAMPLES
CLOSE ALL
Basic Examples
(3)
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]:=
Out[1]=
Take the last 3 elements:
In[1]:=
Out[1]=
Take elements 2 through 4:
In[1]:=
Out[1]=
Scope
(7)
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:
Generalizations & Extensions
(2)
Take
works with any head, not just
List
:
Take
works with
SparseArray
objects:
Applications
(2)
Pick out a subimage:
Sample every third cell in an image:
Properties & Relations
(5)
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
:
Possible Issues
(1)
Take
always returns a list, even if it is just taking a single element:
SEE ALSO
Span
Part
Drop
StringTake
First
Last
Most
Rest
Complement
Select
Cases
TakeWhile
TUTORIALS
Getting Pieces of Lists
Manipulating Lists by Their Indices
MORE ABOUT
Basic Image Manipulation
Elements of Lists
Handling Arrays of Data
Language Overview
List Manipulation
Numerical Data
Parts of Expressions
Parts of Matrices
Rearranging & Restructuring Lists
Structural Operations on Expressions
RELATED LINKS
NKS|Online
(
A New Kind of Science
)
New in 1 | Last modified in 5