KeyMap

KeyMap[f,key1val1,key2val2,]
maps f over the keys in an association, giving .

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

DetailsDetails

  • If any of the are identical, the values associated with later instances replace those associated with earlier ones.
  • KeyMap[f][expr] is equivalent to KeyMap[f,expr].

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Map a function over the keys of an association:

In[1]:=
Click for copyable input
Out[1]=

Use the operator form of KeyMap:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2014
(10.0)