title: Swap two rows in a numpy array in python
body: <p>How to swap xth and yth rows of the 2-D NumPy array? x &amp; y are inputs provided by the user.
  Lets say x = 0 &amp; y =2 , and the input array is as below:</p>
  
  <pre><code>a = [[4 3 1] 
           [5 7 0] 
           [9 9 3] 
           [8 2 4]] 
  Expected Output : 
  [[9 9 3] 
   [5 7 0] 
   [4 3 1] 
   [8 2 4]] 
  </code></pre>
  
  <p>I tried multiple things, but did not get the expected result. this is what i tried:</p>
  
  <pre><code>a[x],a[y]= a[y],a[x]
  
  output i got is:
  [[9 9 3]
   [5 7 0]
   [9 9 3]
   [8 2 4]]
  </code></pre>
  
  <p>Please suggest what is wrong in my solution.</p>