This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / Built-in Functions / Programming / Pattern Matching  /
Select

  • Select[ list , crit ] picks out all elements of list for which crit [ ] is True.
  • Select[ list , crit , n ] picks out the first n elements for which crit [ ] is True.
  • Example: Select[ 1,4,2,7,6 , EvenQ].
  • The object list can have any head, not necessarily List.
  • See the Mathematica book: Section 2.2.7.
  • See also: Cases, Take, Drop.
  • Related package: Statistics`DataManipulation`.

    Further Examples

    This selects the even numbers from the list.

    In[1]:=

    Out[1]=

    This selects those numbers in the list that are greater than 10.

    In[2]:=

    Out[2]=