title: How to replace a single row in a NumPy array
body: <p>I want to replace a row of a NumPy array by the same row after modification by a function. </p>
  
  <p>Here is my code: </p>
  
  <pre><code>def _softmax(z):
     array = np.exp(z)
     array = np.divide(array,np.sum(array))
     return array
  
  a = np.array([[1,2,3,4],[5,15,4,7]])
  n =_softmax(a[0])
  print(n)
  
  a[0]= n
  print(a[0])
  </code></pre>
  
  <p>I get the folowing result : </p>
  
  <pre><code>[0.0320586  0.08714432 0.23688282 0.64391426]
  [0 0 0 0]
  </code></pre>
  
  <p>As you can see, <code>n</code> is okay, but <code>a[0]</code> won't change, except to <code>[0,0,0,0]</code>. 
   However, if I try:</p>
  
  <pre><code>a[0] = np.array([4,3,2,1])
  </code></pre>
  
  <p>...it works perfectly fine.</p>