title: python - Replacing value in a numpy array's column given index from a vector with the same rows
body: <pre><code>A = np.zeros(shape = (3,4))
  A = [[0 0 0 0]
       [0 0 0 0]
       [0 0 0 0]]
  
  B = np.asarray[[2],[0],[3]]
  </code></pre>
  <p>Without a for loop, is there a simple way to change the value of the a components in A (to 1 for example), given the index in B</p>
  <p>Such that:</p>
  <pre><code>A = [[0 0 1 0]
       [1 0 0 0]
       [0 0 0 1]]
  </code></pre>
  <p>I have been able to get this output with a for loop but would prefer it if it didn't for scalability in higher dimensional arrays.</p>