WolframLang: Association to List
To List of Rules
Normal[asso]
-
convert assoc to a List of Rules .
xx = Association[ a -> 3, b -> 2 ]; Normal[ xx ] === {a -> 3, b -> 2 }
Get All Keys
Keys[asso]
-
return a list of the keys.
xx = Association[ a -> 3, b -> 2 ]; Keys[ xx ] === {a, b}
Get All Values
Values[asso]
-
return a list of the values.
xx = Association[ a -> 3, b -> 2 ]; Values[ xx ] === {3, 2}
Get Values by Pattern Matching on Values
Cases
-
return a list of values by matching Pattern
xx = Association[ 1 -> a, 2 -> b, 3 -> 33, 4 -> 44 ]; Cases[ xx, _Integer ] === {33, 44}