KeyMap

KeyMap[f,key1val1,key2val2,]

maps f over the keys in an association, giving f[key1]val1,f[key2]val2,.

KeyMap[f]

represents an operator form of KeyMap that can be applied to an expression.

Details

  • If any of the f[keyi] are identical, the values associated with later instances replace those associated with earlier ones.
  • KeyMap[f][expr] is equivalent to KeyMap[f,expr].
  • Parallelize[KeyMap[f,key1val1,key2val2,]] computes KeyMap[f,key1val1,key2val2,] in parallel on all subkernels. »

Examples

open allclose all

Basic Examples  (2)

Map a function over the keys of an association:

Use the operator form of KeyMap:

Properties & Relations  (1)

Compute KeyMap in parallel:

Wolfram Research (2014), KeyMap, Wolfram Language function, https://reference.wolfram.com/language/ref/KeyMap.html.

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_2024_keymap, author="Wolfram Research", title="{KeyMap}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/KeyMap.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_keymap, organization={Wolfram Research}, title={KeyMap}, year={2014}, url={https://reference.wolfram.com/language/ref/KeyMap.html}, note=[Accessed: 22-December-2024 ]}