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[[#]] &]? – Michael E2 May 02 '19 at 03:05minpos[a_] := SparseArray[UnitStep[# - a]]["AdjacencyLists"] &@Min@aand thenminpos[list]. – Michael E2 May 02 '19 at 03:11