Analyzing a sequence after restructuring it, Counts
returns a sequence similar to below:
assoc = <|{0,1}->8,{1,1}->6,{1,0}->3,{1,-1}->10,{-1,-1}->9,{-1,1}->6,{-1,0}->5,{0,-1}->1|>
I'm only trying to select certain key-values, for example,
keys = {{0, 1}, {1, 0}, {1,-1}, {-1,1}}
Something like KeyTake[assoc, keys]
or KeySelect[assoc, keys]
is returning empty an association <||>
. Forcing the list to be a key isn't working either, such as KeySelect[assoc, Key[{1, 0}]]
. I'm fairly certain there is an elegant way to do this in Mathematica. Does anyone have any suggestions?
KeyTake[assoc, keys]
does not work? It works for me as expect. I am using Mathematica version 12.3.1.0. Maybe this is a version-dependent issue. $\endgroup$