title: numpy array, h[:]=h+1 vs. h=h+1
body: <p>Seems like h[:]=h+1 and  h=h+1 all add 1 to all elements in h.</p>
  
  <p>But difference may be found here below, can you explain why?? Looks like in the second case, h is not only changing as an function internal variable, but also acting like overriding the global variable h...This is so confusing...
  Thank you for any input!</p>
  
  <pre><code>import numpy as np
  
  def fun(h):
      h=h+1
      return h
  
  h=np.zeros((2,2))+1
  hI=h.copy()
  
  for i in range(0,3):          
      hI = fun(h) 
  
  print h
  print hI
  [[ 1.  1.]
   [ 1.  1.]]
  [[ 2.  2.]
   [ 2.  2.]]
  </code></pre>
  
  <p>Whereas</p>
  
  <pre><code>import numpy as np
  
  def fun(h):
      h[:]=h+1
      return h
  
  h=np.zeros((2,2))+1
  hI=h.copy()
  
  for i in range(0,3):          
      hI = fun(h) 
  
  print h
  print hI
  
  [[ 4.  4.]
   [ 4.  4.]]
  [[ 4.  4.]
   [ 4.  4.]]
  </code></pre>