Let's say I have the following list:
l1={{2015, 5, 6, 13692}, {2015, 5, 7, 13715}, {2015, 5, 10, 13274},
{2015, 5, 11, 13581}, {2015, 5, 12, 13609}};
How is it possible to rearrange so it becomes
l2={{{2015, 5, 6}, 13692}, {{2015, 5, 7}, 13715}, {{2015, 5, 10}, 13274},
{{2015, 5, 11}, 13581}, {{2015, 5, 12}, 13609}}
That is, I want to partition each sublist of l1 and make it look like l2.
Composition[Through, {Most, Last}] /@ l1? – J. M.'s missing motivation Aug 08 '17 at 19:42restructure[{a__, b_}] := {{a}, b},restructure /@ l1gives the desired result. – m_goldberg Aug 08 '17 at 20:53