Skip to content

AssociationThread ​

An Association pairing keys with values, positionally.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageAssociationThread✓
AssociationThread(keys, values)Association(Rule(keys[1], values[1]), …) — keys and values the same length
AssociationThread(keys -> values)the same, with keys and values given as one Rule instead of two arguments
Typed signatures
TypePackageApplies
(collection<any> | expression<Rule>, collection<any>?) -> anycombinatoricsalways

Domain: Collections

Details
  • Builds the SAME Association head as Association — Rule pairs, not compute-engine's string-keyed Dictionary. See that entry's own notes for why.

Examples

Basic #
live ↗
InAssociationThread([a,b],[1,2])\mathrm{AssociationThread}(\bigl\lbrack a, b\bigr\rbrack, \bigl\lbrack1, 2\bigr\rbrack)OutAssociation(Rule(a,1),Rule(b,2))\mathrm{Association}(\mathrm{Rule}(a, 1), \mathrm{Rule}(b, 2))
Scope #
live ↗
InAssociationThread(Rule([a,b],[1,2]))\mathrm{AssociationThread}(\mathrm{Rule}(\bigl\lbrack a, b\bigr\rbrack, \bigl\lbrack1, 2\bigr\rbrack))OutAssociation(Rule(a,1),Rule(b,2))\mathrm{Association}(\mathrm{Rule}(a, 1), \mathrm{Rule}(b, 2))
live ↗
InLength(AssociationThread([a,b,c],[1,2,3]))\mathrm{Length}(\mathrm{AssociationThread}(\bigl\lbrack a, b, c\bigr\rbrack, \bigl\lbrack1, 2, 3\bigr\rbrack))Out33
About
Examples3
Checked againstWolfram Language 3 agree
CrosswalkWolfram Language

See also: Association