I would like to find the positions of multiple occurrences of a minimum value in a list. For instance, for the list {1, 2, 1, 3}, I want to obtain the two positions for the occurrences of the number 1.
MinimalBy[{1, 2, 1, 3}, id (x)] gives me these occurrences, but not the positions.
MinimalBy[Range@Length@list, list[[#]] &]
? $\endgroup$minpos[a_] := SparseArray[UnitStep[# - a]]["AdjacencyLists"] &@Min@a
and thenminpos[list]
. $\endgroup$