You really only need Map
(/@
as binary operator) and, in many cases, a custom function expressing what you want to do with each of sublists at level 1. Mathematica's ability to match argument patterns with the data given to a function will take care to the rest.
Here are the most common use-cases.
Function works directly on the sublists at level 1.
data =
{{{a1, b1, c1}, {d1, e1, f1}},
{{a2, b2, c2}, {d2, e2, f2}},
{{a20, b20, c20}, {d20, e20, f20}}};
Transpose /@ data
{{{a1, d1}, {b1, e1}, {c1, f1}},
{{a2, d2}, {b2, e2}, {c2, f2}},
{{a20, d20}, {b20, e20}, {c20, f20}}}
Function works directly on the two lists contained in the sublists at level 1.
f[{l1_List, l2_List}] := l1^l2
f /@ data
{{a1^d1, b1^e1, c1^f1}, {a2^d2, b2^e2, c2^f2}, {a20^d20, b20^e20, c20^f20}}
Function works directly on the elements of the two lists contained in the sublists at level 1.
g[{{a_, b_, c_}, {d_, e_, f_}}] := d Sin[a] + e Cos[b] + f Tan[c]
g /@ data
{e1 Cos[b1] + d1 Sin[a1] + f1 Tan[c1],
e2 Cos[b2] + d2 Sin[a2] + f2 Tan[c2],
e20 Cos[b20] + d20 Sin[a20] + f20 Tan[c20]}
Map
a function overdata1
, TryMap[func, data1]
to see what the result would look like. Besides, isn't this a very similar question to your previous one? $\endgroup$R
? $\endgroup$