|
SOLUTIONS
|
Elements of Lists
Mathematica provides a carefully chosen set of functions for accessing elements of lists using either indices or positions, or using patterns or criteria for their values.
ReferenceReference
list[[...]] (Part) — parts of lists, resettable with ![]()
Span (;;) — general specification for spans or blocks of elements
First ▪ Last ▪ Rest ▪ Most ▪ Take ▪ Drop ▪ TakeWhile
Append ▪ Prepend ▪ Insert ▪ Delete ▪ AppendTo ▪ PrependTo
Position — find positions of elements matching a pattern
Extract ▪ ReplacePart ▪ MapAt ▪ ArrayRules ▪ Ordering
Length ▪ Dimensions ▪ ArrayDepth ▪ LengthWhile
Select — select elements that satisfy a criterion
Cases — give elements that match a pattern
Pick ▪ DeleteCases ▪ BinLists ▪ Count ▪ DeleteDuplicates
MemberQ — test whether an element is a member of a list
