AssociationMap

AssociationMap[f,{key1,key2,}]
creates the association .

AssociationMap[f,key1val1,key2val2,]
creates the association .

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

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Create an association by mapping a function over a list of keys:

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

Create an "inverted index" by swapping keys and values:

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

Use the operator form of AssociationMap:

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