Tag Info

New answers tagged

1

list = {{1, {4, 2, 0}}, {4, {2, 4, 0}}, {-2, {3, 3, 0}}, {1, {3, 0, 3}}, {-3, {0, 4, 2}}}; Transpose[{Plus @@@ #[[All, All, 1]], #[[All, 1, 2]]} &[GatherBy[list, Sort[Last[#]] &]]]


1

So I simplified the problem, I created a list of fruit. Sorting the fruit list without the ordering function that produces the expected result. In[]= Sort[list[[All, 2]]] Out[]= {"apple", "banana", "orange"} However when I sort the fruit list with an ordering function, I see the same unexpected results. In[]= Sort[list[[All, 2]], #1 < #2 &] ...



Top 50 recent answers are included