title: Modify a particular row/column of a NumPy array
body: <p>How do I modify particular a row or column of a NumPy array?</p>
  
  <p>For example I have a NumPy array as follows:</p>
  
  <pre><code>P = array([[1, 2, 3],
             [4, 5, 6]])
  </code></pre>
  
  <p>How do I change the elements of first row, <code>[1, 2, 3]</code>, to <code>[7, 8, 9]</code> so that the <code>P</code> will become: </p>
  
  <pre><code>P = array([[7, 8, 9],
             [4, 5, 6]])
  </code></pre>
  
  <p>Similarly, how do I change second column values, <code>[2, 5]</code>, to <code>[7, 8]</code>?</p>
  
  <pre><code>P = array([[1, 7, 3],
             [4, 8, 6]])
  </code></pre>