I have a nested list with 1-D sublists of equal length. I want to subtract another list from each of these sublists.
Task: Subtracting B
from each element in A
to get the result C
.
A = {{5,3,5,7,2},{2,6,4,8,3}}
B = {1,2,1,2,1}
C = {{4,1,4,5,1},{1,4,3,6,2}}
I've used multiple tables to perform this. However, the code takes too long, especially for many nests (columns)*. Is there a faster way?
*In my case, I have many nests as it is time series data. Each nest represents a new column.