I have a 2D array 'A' with the shape (1015, 1200). Variable L1 has the lower indices and L2 has higher indices. On every one of the 1015 rows in A, I want to change the values of the elements between L1 and L2 pertaining to that row. I am using a for loop to carry this operation now and I want to know if there is any better way.
Here is the code that I am using now:
for i in range(A.shape[0]):
A[i, L1[i]:L2[i]] = 0
Thank you.