I have got an array like this:
A = {{{1, 4, 5}, {3, 7, 15}}, {{5, 6, 9}, {7, 8, 2}}, {{9, 10,
1}, {11, 12, 3}}}
I make differences in each sublist a following way
Dif = Differences[A, {0, 0, 1}]
and get
{{{3, 1}, {4, 8}}, {{1, 3}, {1, -6}}, {{1, -9}, {1, -9}}}
Then I want to duplicate the first difference in each sublist, which means I would like to obtain array like this:
{{{3, 3, 1}, {4, 4, 8}}, {{1, 1, 3}, {1, 1, -6}}, {{1, 1, -9}, {1, 1, -9}}}
Does anyone know how to do it? Is there any function which would help?
list[[All, All, {1,1,2}]]
? $\endgroup$