Lets say have an array of the form
r=([[[3,2,1],[5,4,1]],[[10,6,3],[5,3,1]],[[9,5,2],[8,4,1]]])
And I want to do a subtraction between the elements of each array but getting the following array
r=([[[3-3,3-2,3-1],[5-5,5-4,5-1]],[[10-10,10-6,10-3],[5-5,5-3,5-1]],[[9-9,9-5,9-2],[8-8,8-4,8-1]]])
r=([[[0,1,2],[0,1,4]],[[0,4,7],[0,2,4]],[[0,4,7],[0,4,7]]])
I have tried loops inside loops but I don't get what I want because I don't know how to restart the value I'm subtracting in each array.
numpy? Also, you haven't show your code to get that output for us to assist with.