I have an Association in which the keys are lists. The first key might be
{20, a, b}
and the second key might be
{47, e, g}
and so on. How can I lookup or extract all values for which the first element in each key is, say, 20? I guess I’m looking for the Association equivalent of
You might be able to accomplish this with the new KeyValuePattern object in Mathematica 10.4. I’ve tried, though, and can’t seem to figure out what function should then be used to actually apply the pattern to select matching key->value pairs from an association. I crafted a test association that is similar to yours, with keys that are lists, and was able to get MatchQ working with a KeyValuePattern such as: