I had a 2D array where every row has 2 elements:
R3 = [
[[0, 4, 4, ...]
[[0, 0, 0, ...]
[[4, 0, 0, ...]
]
And this is the position of elements of the 2D array.
whereR3 = [
[0, 1],
[0, 2],
[1, 4],
[1, 34],
[2, 0],
[2, 5],
[3, 8],
[3, 9],
[4, 12],
]
I want to do subtract the second element of a row from the first element, but the bottleneck is getting the value in a certain position from the 2D array. Here's what I've tried:
print(R3[0][1] - R3[0][2])
With this code, I can't calculate through every row and can't do it in a loop.