Mathematica tends to involve modifying the whole list until you get the thing you want rather than looping and contracting new lists.
This is how I would think about it:
y = {{a}, {b}, {c}, {d}, {e}, {f}, {g}, {h}, {i}, {j}, {k}, {l}}
Get rid of the inside lists
Flatten[y]
{a, b, c, d, e, f, g, h, i, j, k, l}
Divide lists up uses Partition
Partition[Flatten[y],3]
{{a, b, c}, {d, e, f}, {g, h, i}, {j, k, l}}
I'm assuming you're adding 3 elements and diving by three to get a mean? I'll use Mean
.
Mean/@Partition[Flatten[y],3]
{1/3 (a + b + c), 1/3 (d + e + f), 1/3 (g + h + i), 1/3 (j + k + l)}
( This is short for Map[Mean, Partition[Flatten[y],3]]
)
Then to get each element wrapped in a list as in your answer:
Transpose[{Mean/@Partition[Flatten[y],3]}]
{{1/3 (a + b + c)}, {1/3 (d + e + f)}, {1/3 (g + h + i)}, {1/
3 (j + k + l)}}
( Alternatively List/@Mean/@Partition[Flatten[y],3]
)
Developer`PartitionMap[Mean, y, 3]
$\endgroup$