AssociationThread

AssociationThread[{key1,key2,}{val1,val2,}]

gives the association key1val1,key2val2,.

AssociationThread[{key1,key2,},{val1,val2,}]

also gives the association key1val1,key2val2,.

Details

  • If any of the keyi are repeated, later instances replace earlier ones.
  • AssociationThread[keys:>values] yields an association in which every element uses a delayed rule.

Examples

Basic Examples  (3)

Create an association from two lists:

Repeated keys replace earlier ones:

Create an association with delayed values:

Get the current date and temperature:

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

Text

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

BibTeX

@misc{reference.wolfram_2021_associationthread, author="Wolfram Research", title="{AssociationThread}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/AssociationThread.html}", note=[Accessed: 19-September-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_associationthread, organization={Wolfram Research}, title={AssociationThread}, year={2014}, url={https://reference.wolfram.com/language/ref/AssociationThread.html}, note=[Accessed: 19-September-2021 ]}

CMS

Wolfram Language. 2014. "AssociationThread." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AssociationThread.html.

APA

Wolfram Language. (2014). AssociationThread. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AssociationThread.html