

KeyMap
Details

Examples
open all close allBasic Examples (2)
Scope (1)
In KeyMap[f,assoc], if applying f produces repeated keys, later instances replace earlier ones:
Properties & Relations (4)
KeyMap[f,assoc] is equivalent to AssociationThread[Map[f,Keys[assoc]]Values[assoc]]:
KeyMap[f,assoc] gives an association with the same length as DeleteDuplicatesBy[Keys[assoc],f]:
KeyMap maps a function over the keys in an association:
Map maps a function over the values in an association:
KeyValueMap maps a function over the keys and values in an association (and returns a list):
AssociationMap maps a function over the rules in an association:
KeyMap can be parallelized automatically:
Related Guides
History
Text
Wolfram Research (2014), KeyMap, Wolfram Language function, https://reference.wolfram.com/language/ref/KeyMap.html.
CMS
Wolfram Language. 2014. "KeyMap." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KeyMap.html.
APA
Wolfram Language. (2014). KeyMap. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KeyMap.html
BibTeX
@misc{reference.wolfram_2025_keymap, author="Wolfram Research", title="{KeyMap}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/KeyMap.html}", note=[Accessed: 15-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_keymap, organization={Wolfram Research}, title={KeyMap}, year={2014}, url={https://reference.wolfram.com/language/ref/KeyMap.html}, note=[Accessed: 15-August-2025]}