|
Part
expr[[i]] or Part[expr, i] gives the i part of expr.
expr[[-i]] counts from the end.
expr[[0]] gives the head of expr.
expr[[i, j, ... ]] or Part[expr, i, j, ... ] is equivalent to expr[[i]] [[j]] ... .
expr[[  , , ... ]] gives a list of the parts , , ... of expr.
You can make an assignment like t[[i]] = value to modify part of an expression.
When expr is a list, expr[[  , , ... ]] gives a list of parts. In general, the head of expr is applied to the list of parts.
You can get a nested list of parts from expr[[ , , ... ]]. Each part has one index from each list.
If any of the are All, all parts at that level are kept.
expr[[All, i]] effectively gives the i column in expr.
Notice that lists are used differently in Part than in functions like Extract, MapAt and Position.
expr[[ Range[i, j] ]] can be used to extract sequences of parts.
In StandardForm and InputForm, expr[[spec]] can be input as expr spec .
 and can be entered as [[ and ]] or \[LeftDoubleBracket] and \[RightDoubleBracket].
In StandardForm, expr[[spec]] can be input as or 
See The Mathematica Book: Section 1.2.4, Section 1.2.4, Section 1.4.7, Section 1.8.4, Section 1.8.4 and Section 2.1.4.
See also: First, Head, Last, Extract, Position, ReplacePart, MapAt, Take, PadLeft.
Related package: LinearAlgebra`MatrixManipulation`.
Further Examples
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT. SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION. | |