Let’s say I have a matrix like
m={{1,a,2},{4,b,3},{6,a,8},{7,c,10},{2,c,5}}
How can I use GroupBy to pick the first and third elements using the second one? I tried
GroupBy[m, #[[2]]&->#[[{1,3}]]&]
which is apparently wrong.
100% Private Proxies – Fast, Anonymous, Quality, Unlimited USA Private Proxy!
Get your private proxies now!
Let’s say I have a matrix like
m={{1,a,2},{4,b,3},{6,a,8},{7,c,10},{2,c,5}}
How can I use GroupBy to pick the first and third elements using the second one? I tried
GroupBy[m, #[[2]]&->#[[{1,3}]]&]
which is apparently wrong.