title: what does .dtype do?
body: <p>I am new to Python, and don't understand what <code>.dtype</code> does. <br>For example:</p>
  
  <pre><code>&gt;&gt;&gt; aa
  array([1, 2, 3, 4, 5, 6, 7, 8])
  &gt;&gt;&gt; aa.dtype = "float64"
  &gt;&gt;&gt; aa
  array([  4.24399158e-314,   8.48798317e-314,   1.27319747e-313,
       1.69759663e-313])
  </code></pre>
  
  <p>I thought dtype is a property of aa, which should be int, and if I assign <code>aa.dtype = "float64"</code> <br> then<code>aa</code> should become <code>array([1.0 ,2.0 ,3.0, 4.0, 5.0, 6.0, 7.0, 8.0])</code>.</p>
  
  <p>Why does it changes its value and size? <br>What does it mean?</p>
  
  <p>I was actually learning from a piece of code, and shall I paste it here:</p>
  
  <pre><code>def to_1d(array):
   """prepares an array into a 1d real vector"""
      a = array.copy() # copy the array, to avoid changing global
      orig_dtype = a.dtype
      a.dtype = "float64" # this doubles the size of array
      orig_shape = a.shape
      return a.ravel(), (orig_dtype, orig_shape) #flatten and return
  </code></pre>
  
  <p>I think it shouldn't change the value of the input array but only change its size. Confused of how the function works</p>