title: Numpy: assignment destination is read-only - broadcast
body: <p>I start with a 2D array and want to broadcast it to a 3D array (eg. from greyscale image to rgb image). This is the code I use.</p>
  
  <pre><code>&gt;&gt;&gt; img_grey = np.random.randn(4, 4)
  &gt;&gt;&gt; img_rgb = np.broadcast_to(np.expand_dims(img_grey, axis=-1), (4, 4, 3))
  </code></pre>
  
  <p>This creates an array <code>img_rgb</code> that works as expected: 3 colored channels (last dimension), each slice being equal to the original greyscale image. However, if I do</p>
  
  <pre><code>&gt;&gt;&gt; img_rgb[0, 0, 0] = 0.
  ValueError: assignment destination is read-only
  </code></pre>
  
  <p>I can't change the rgb image!</p>