How do I use Mathematica’s Gather/Collect/Transpose functions to convert:
{ { {1, foo1}, {2, foo2}, {3, foo3} }, { {1, bar1}, {2, bar2}, {3, bar3} } }
to
{ {1, foo1, bar1}, {2, foo2, bar2}, {3, foo3, bar3} }
EDIT: Thanks! I was hoping there was a simple way, but I guess not!
Here is your list:
Here is one way:
EDIT
Here is a completely different version, just for fun:
EDIT 2
And here is yet another way, using linked lists and inner function to accumulate the results:
EDIT 3
Ok, for those who consider all of the above too complicated, here is a really simple rule – based solution: