title: In-place type conversion of a NumPy array
body: <p>Given a NumPy array of <code>int32</code>, how do I convert it to <code>float32</code> <strong>in place</strong>?  So basically, I would like to do</p>
  
  <pre><code>a = a.astype(numpy.float32)
  </code></pre>
  
  <p>without copying the array.  It is big.</p>
  
  <p>The reason for doing this is that I have two algorithms for the computation of <code>a</code>.  One of them returns an array of <code>int32</code>, the other returns an array of <code>float32</code> (and this is inherent to the two different algorithms).  All further computations assume that <code>a</code> is an array of <code>float32</code>.</p>
  
  <p>Currently I do the conversion in a C function called via <code>ctypes</code>.  Is there a way to do this in Python?</p>