title: Why can the datatype of an array not be changed inside a loop?
body: <p>I've got a structure of a list of arrays with complex entries and I want to convert them into floats. The imaginary part can be discarded, thats fine.</p>
  <pre><code>import numpy as np
  
  a=np.array([2+3j,3+4j])
  b=np.array([1+2j,4+3j])
  arrays=[a,b]
  
  for i,y in enumerate(arrays):
      y=y.astype('float64')
  
  print(arrays)
  </code></pre>
  <p>I am wondering, why this doesn't work, while on the other hand, changing the type to float before creating the list 'arrays' does work.</p>
  <pre><code>import numpy as np
  
  a=np.array([2+3j,3+4j])
  b=np.array([1+2j,4+3j])
  a=a.astype('float64')
  b=b.astype('float64')
  arrays=[a,b]
  print(arrays)
  </code></pre>
  <p>This is a very basic question, but I would be very happy, if someone could share his or her thoughts about this.</p>
  <p>Thanks in advance :)</p>