title: array slicing in numpy
body: <p>today I used the numpy array for some calculation and found a strange problem, for example, assume i already imported numpy.arange in Ipython, and I run some scripts as follows: </p>
  
  <pre><code>In [5]: foo = arange(10)                                                      
  
  In [8]: foo1 = foo[arange(3)]                                                 
  
  In [11]: foo1[:] = 0                                                          
  
  In [12]: foo
  Out[12]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
  
  In [16]: foo2 = foo[0:3]                                                      
  
  In [19]: foo2[:]=0                                                            
  
  In [21]: foo
  Out[21]: array([0, 0, 0, 3, 4, 5, 6, 7, 8, 9])
  </code></pre>
  
  <p>above shows that when i slice the array by foo[arange(3)], i got a copy of the array slice, but when i slice the array by foo[0:3], i got a reference of the array slice, thus foo changes with foo2. Then I thought foo and foo2 should have the same id, but that seems is not true</p>
  
  <pre><code>In [59]: id(foo)
  Out[59]: 27502608
  
  In [60]: id(foo2)
  Out[60]: 28866880
  
  In [61]: id(foo[0])
  Out[61]: 38796768
  
  In [62]: id(foo2[0])
  Out[62]: 38813248
  
  ...
  </code></pre>
  
  <p>even more strange, if I keep checking the id of foo and foo2, they are not constant, and sometimes, they did match each other!</p>
  
  <pre><code>In [65]: id(foo2[0])
  Out[65]: 38928592
  
  In [66]: id(foo[0])                                                          
  Out[66]: 37111504
  
  In [67]: id(foo[0])
  Out[67]: 38928592
  </code></pre>
  
  <p>can anyone explain this a little bit? I am really confused by this dynamic feature of python</p>
  
  <p>thanks alot</p>