I am still new in Mathematica, and I need some help here. Suppose that I have an association
A=Association[1 -> 1, 2 -> 1, 3 -> 4, 4 -> 6, 5 -> 4, 6 -> 4, 7 -> 2, 8 -> 2, 9 -> 2, 10 -> 1, 11 -> 4, 12 -> 1, 13 -> 3, 14 -> 2, 15 -> 3, 16 -> 1]
and I want to get the output of key with the lowest value, which is
{1, 2, 10, 12, 16}
I know that ArgMin
can't get my desired answer. So I tried Position[A, Min[A]]
, but instead it gives me the output
{{Key[1]}, {Key[2]}, {Key[10]}, {Key[12]}, {Key[16]}}
Is there a solution?
PositionIndex[#][Min@#] &[A]
(see here) $\endgroup$ – user1066 Jun 27 '17 at 23:57