yields an association containing only the elements with keys keyi.
gives a list of associations.
represents an operator form of KeyTake that can be applied to an expression.
- KeyTake[assoc,…] gives an Association object whose elements are in the order of the keyi.
- Any keyi that does not appear in assoc is ignored.
- KeyTake can be applied not only to Association objects, but also to lists of rules.
- KeyTake[keys][expr] is equivalent to KeyTake[expr,keys].
Basic Examples (7)
Select rules from an association, given a list of keys:
Select from several associations, given a list of keys:
Select rules from a list, given keys:
Select rules from several lists:
Select from an association, using a single key:
Select from a list, using a single key:
Use the operator form of KeyTake:
Introduced in 2014