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