title: Numpy assigning to slice, when is the array copied
body: <p>So with numpy arrays assigning one to another just copies the reference:
  i.e.</p>
  
  <pre><code>import numpy as np
  x = np.array([5,8])
  y = x 
  y += 1
  x
  Out: array([6, 9])
  </code></pre>
  
  <p>And if I want a deep copy then I should use <code>x.copy()</code>. And the same is true when taking a view out of a higher dimensional array, e.g.</p>
  
  <pre><code>A=np.array([[4,10],[8,1]])
  b=A[:,1]
  b+=1
  A
  Out: array([[ 4, 11],
              [ 8,  2]])
  </code></pre>
  
  <p>And the other way round (continuing from above):</p>
  
  <pre><code>A[:,1]=b
  b
  Out: array([11,  2])
  b+=1
  A
  Out: array([[ 4, 12],
              [ 8,  3]])
  </code></pre>
  
  <p>So up to here everything is working consistently. But now if I carry on and do:</p>
  
  <pre><code>A[:,0] = b
  A
  Out: array([[12, 12],
              [ 3,  3]])
  b
  Out: array([12,  3])
  b+=1
  A
  Out: array([[12, 13],
              [ 3,  4]])
  </code></pre>
  
  <p>What I don't understand is why the first column stays the same and the other doesn't? Why does the second column continue to point to the b array? Is there any rule for deciding when an array will be deep copied on assignment?</p>