title: Replace elements in a numpy ndarray accessed via index array
body: <p>I want to replace certain columns in a multi-dimensional array with the value that I have. I tried the following.</p>
  
  <pre><code>cols_to_replace = np.array([1, 2, 2, 2])
  
  original_array = np.array([[[255, 101,  51],
      [255, 101, 153],
      [255, 101, 255]],
  
     [[255, 153,  51],
      [255, 153, 153],
      [255, 153, 255]],
  
     [[255, 203,  51],
      [255, 204, 153],
      [255, 205, 255]],
  
     [[255, 255,  51],
      [255, 255, 153],
      [255, 255, 255]]], dtype=int)
  </code></pre>
  
  <p>Replace just the cols with <code>(0, 0, 255)</code></p>
  
  <p>I was hoping that I can index all the columns using the array <code>cols_to_replace</code></p>
  
  <pre><code> original_array[:, cols_to_replace] = (0, 0, 255)
  </code></pre>
  
  <p>This gave a wrong answer! </p>
  
  <p><strong>Unexpected output.</strong></p>
  
  <pre><code>array([[[255, 101,  51],
      [  0,   0, 255],
      [  0,   0, 255]],
  
     [[255, 153,  51],
      [  0,   0, 255],
      [  0,   0, 255]],
  
     [[255, 203,  51],
      [  0,   0, 255],
      [  0,   0, 255]],
  
     [[255, 255,  51],
      [  0,   0, 255],
      [  0,   0, 255]]])
  </code></pre>
  
  <p><strong>My expected output is</strong></p>
  
  <pre><code>array([[[255, 101,  51],
      [  0,   0, 255],
      [255, 101, 255]],
  
     [[255, 153,  51],
      [255, 153, 153],
      [  0,   0, 255]],
  
     [[255, 203,  51],
      [255, 204, 153],
      [  0,   0, 255]],
  
     [[255, 255,  51],
      [255, 255, 153],
      [  0,   0, 255]]])
  </code></pre>
  
  <ul>
  <li><p>What is really happening?</p></li>
  <li><p>How do I accomplish what I am trying to do (that is access, col 1, col 2, col 2, col 2 in each of these rows and replace the values.</p></li>
  <li><p>If I want to delete those columns, is there a <code>numpy</code> way to do it?</p></li>
  </ul>