Elements of Lists

The Wolfram Language 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.

list[[...]] (Part) parts of lists, resettable with =

Span (;;) general specification for spans or blocks of elements

First  ▪  Last  ▪  Rest  ▪  Most  ▪  Take  ▪  Drop  ▪  TakeDrop  ▪  TakeList  ▪  TakeWhile

UpTo a certain number of elements, or as many as are available

Append  ▪  Prepend  ▪  Insert  ▪  Delete  ▪  AppendTo  ▪  PrependTo

Position find positions of elements matching a pattern

FirstPosition  ▪  Extract  ▪  ReplacePart  ▪  MapAt  ▪  ArrayRules  ▪  Ordering

Length  ▪  Dimensions  ▪  ArrayDepth  ▪  LengthWhile

Select, SelectFirst select elements that satisfy a criterion

Cases, FirstCase give elements that match a pattern

Pick  ▪  DeleteCases  ▪  BinLists  ▪  Count  ▪  DeleteDuplicates

Nothing an element automatically removed from lists

MemberQ test whether an element is a member of a list

FreeQ  ▪  ArrayQ  ▪  VectorQ  ▪  MatrixQ

AllTrue  ▪  AnyTrue  ▪  NoneTrue

Max  ▪  Min  ▪  MaximalBy  ▪  MinimalBy

Finding Sublists

SequencePosition  ▪  SequenceCases  ▪  SequenceCount

Related Tutorials