title: numpy array slicing: explicit/implicit copies and memory management
body: <p>This is a beginner python question and has ultimately to do with memory management.</p>
  
  <p>I am slicing an uint32 numpy array into 2 parts and then trying to create an uint8 view of one of the subarrays. Note that by creating a view, I mean re-interpreting the underlying data in memory in uint8, not casting the variable in uint8 : so the size changes in the process.</p>
  
  <p>This is the inital array and an example of the view, works fine :</p>
  
  <pre><code>a=np.array([(1,2,3,4),(5,6,7,8),(9,10,11,12)],np.int32)
  a.view(np.int8) # everything is fine
  </code></pre>
  
  <p>This crashes (c is not a hard copy and still tied to the original array) :</p>
  
  <pre><code>a=np.array([(1,2,3,4),(5,6,7,8),(9,10,11,12)],np.int32)
  c, a= np.split (a,[1],1);
  c.view(np.int8) #oups
  </code></pre>
  
  <p>Ditching the original array before creating the view doesn't help either :</p>
  
  <pre><code>a=np.array([(1,2,3,4),(5,6,7,8),(9,10,11,12)],np.int32)
  c, b= np.split (a,[1],1);
  del a
  c.view(np.int8) #oups
  </code></pre>
  
  <p>This is the best I came up with :</p>
  
  <pre><code>a=np.array([(1,2,3,4),(5,6,7,8),(9,10,11,12)],np.int32)
  c, a= np.split (a,[1],1);
  c=np.copy(c).view(np.uint8) #ok, but really ?!?
  </code></pre>
  
  <p>Is there a better way to split an array into 2 subarrays so that numpy consider them "native", without copying them ? (of course the original array is then discarded)</p>