KeySelect
Details
- KeySelect yields an Association object whose elements appear in the same order as they did in assoc.
- KeySelect can be applied not only to Association objects, but also to lists of rules.
- KeySelect[crit][assoc] is equivalent to KeySelect[assoc,crit].
- Parallelize[KeySelect[assoc,crit]] computes KeySelect[assoc,crit] in parallel on all subkernels. »
Examples
open all close allBasic Examples (3)
KeySelect[<|1 -> a, 2 -> b, 3 -> c|>, OddQ]Select entries from an association, using another association as a criterion:
KeySelect[<|1 -> a, 2 -> b, 3 -> c|>, <|1 -> False, 2 -> True, 3 -> True|>]Use the operator form of KeySelect:
KeySelect[OddQ][<|1 -> 2, 2 -> 3, 3 -> 4|>]Properties & Relations (1)
Compute KeySelect in parallel:
Parallelize[KeySelect[AssociationMap[Identity, Range[100]], PrimeQ]]Related Guides
History
Text
Wolfram Research (2014), KeySelect, Wolfram Language function, https://reference.wolfram.com/language/ref/KeySelect.html.
CMS
Wolfram Language. 2014. "KeySelect." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KeySelect.html.
APA
Wolfram Language. (2014). KeySelect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KeySelect.html
BibTeX
@misc{reference.wolfram_2026_keyselect, author="Wolfram Research", title="{KeySelect}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/KeySelect.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_keyselect, organization={Wolfram Research}, title={KeySelect}, year={2014}, url={https://reference.wolfram.com/language/ref/KeySelect.html}, note=[Accessed: 13-June-2026]}