| Author |
Comment/Response |
yiannis
|
04/21/06 10:57am
Hi,
I have the following list structure:
ll={{2,a},{6,b},{6,a},{13,b},{27,a},{15,c},...
,{45,d},...,{28,d},...}
and I want to produce something like:
newll={{2+6+27+...,a},{6+13+...,b},{15,c},...,{45+28+...,d},...},
that is, I want to merge the sublists which have the same SECOND element and at the same time SUM their first elements to produce a new sublist of the form: {SUM[first elements], common second element}
Thanks in advance,
Y.
URL: , |
|