title: python - ValueError: could not broadcast input array from shape (2,2) into shape (3,)
body: <p>I'm having an image &quot;img_carree&quot; that I would like to change (of size 427x427, each pixel carry the RGB value)</p>
  <pre><code>M = np.array(img_carree)
  M.shape                #return(427,427,3)
  </code></pre>
  <p>I also have a color object</p>
  <pre><code>color = (255,255,0)
  </code></pre>
  <p>So I am trying to check for the correlation between each pixels of my image with the color and store it in a new numpy array</p>
  <pre><code>F = M
  for i in range(427):
     for j in range(427):
          F[i][j] = np.corrcoef(M[i][j], np.array(color))
  </code></pre>
  <p>But I always run into the problem of &quot;ValueError: could not broadcast input array from shape (2,2) into shape (3,)&quot;
  <br>
  Anyhow thank you for reading my question</p>