title: Row exchange in Numpy
body: <p>In Python I can exchange 2 variables by mean of multiple affectation; it works also with lists:</p>
  
  <pre class="lang-py prettyprint-override"><code>l1,l2=[1,2,3],[4,5,6]
  l1,l2=l2,l1
  print(l1,l2)
  &gt;&gt;&gt; [4, 5, 6] [1, 2, 3]
  </code></pre>
  
  <p>But when I want to exchange 2 rows of a numpy array (for example in the Gauss algorithm), it fails:</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  a3=np.array([[1,2,3],[4,5,6]])
  print(a3)
  a3[0,:],a3[1,:]=a3[1,:],a3[0,:]
  print(a3)
  &gt;&gt;&gt; [[1 2 3]
       [4 5 6]]
      [[4 5 6]
       [4 5 6]]
  </code></pre>
  
  <p>I thought that, for a strange reason, the two columns were now pointing to the same values; but it's not the case, since <code>a3[0,0]=5</code> after the preceeding lines changes a3[0,0] but not a3[1,0].</p>
  
  <p>I have found how to do with this problem: for example <code>a3[0,:],a3[1,:]=a3[1,:].copy(),a3[0,:].copy()</code> works. But can anyone explain why exchange with multiple affectation fails with numpy rows? My questions concerns the underlying work of Python and Numpy.</p>