yields an association containing only the elements with keys keyi.
gives a list of associations.
- 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:
Wolfram Research (2014), KeyTake, Wolfram Language function, https://reference.wolfram.com/language/ref/KeyTake.html.
Wolfram Language. 2014. "KeyTake." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KeyTake.html.
Wolfram Language. (2014). KeyTake. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KeyTake.html