In python (I am new working with python), I have a matrix built inside a loop in the following way:
A[:,index_i ,index_j] = B[:,index_i ,index_j] - C[:,index_i ,index_j]
Just after that inside the same loop there are some calculations on A
, but before I need to get A
with each element positive for those operations, then, writing this will work so each A[k,index_i,index_j]>=0
?
A[:,index_i ,index_j]= abs( B[:,index_i ,index_j] - C[:,index_i ,index_j] )
If possible, I want to avoid more loops to have every element positive.
Thank you!