Details
- The object list can have any head, not necessarily List.
- When used on an Association, Select picks out elements according to their values.
- Select can be used on SparseArray objects. »
- Select[crit][list] is equivalent to Select[list,crit].
Examples
open allclose allBasic Examples (5)
Select elements that are even:
Use a pure function to test each element:
Return only the first expression selected:
Use the operator form of Select:
Select operates on values in an Association:
Scope (5)
Select picks out elements for which applying the criterion explicitly yields True:
Applying the criterion to the symbolic object x does not explicitly yield True:
Find up to 2 pairs containing x:
Fewer than the requested elements may be returned:
Use an operator form as selection criterion:
Use Select in operator form:
Generalizations & Extensions (2)
Applications (7)
Select numbers up to 100 that equal 1 modulo both 3 and 5:
Select 4-tuples that read the same in reverse:
Find the first four 3×3 matrices of 0s and 1s that have determinant 1:
Select eigenvalues that lie within the unit circle:
Find built-in Wolfram Language objects whose names are less than 3 characters long:
Select numeric quantities from a product:
Find an approximation to by finding the proportion of points that lie within a disk:
Properties & Relations (2)
Select is similar to Cases except that it uses a function instead of a pattern:
Select the lists that have sum of elements less than 10:
Use Cases to get the same result:
Select elements that are even:
Separate odd and even elements:
Construct an association that explicitly contains as keys the results of the criterion function:
Related Guides
Related Links
- Fast Introduction for Programmers: Functionals & Operators
- An Elementary Introduction to the Wolfram Language : Tests and Conditionals
- An Elementary Introduction to the Wolfram Language : Expressions and Their Structure
- An Elementary Introduction to the Wolfram Language : Natural Language Understanding
- An Elementary Introduction to the Wolfram Language : Creating Websites and Apps
- An Elementary Introduction to the Wolfram Language : Datasets
- NKS|Online (A New Kind of Science)