title: Assigning real and imaginary parts of a complex array from two arrays containing the two parts - Python
body: <p>I have two arrays, <code>field_in_k_space_REAL</code> and <code>field_in_k_space_IMAGINARY</code>, that contain, respectively, the real and imaginary parts of an array of complex numbers, <code>field_in_k_space_TOTAL</code>, which I would like to create. Why does the following assignment not work, producing the error</p>
  
  <pre><code>AttributeError: attribute 'real' of 'numpy.generic' objects is not writable
  
  
  field_in_k_space_TOTAL = zeros(n, complex)
  for i in range(n):
      field_in_k_space_TOTAL[i].real = field_in_k_space_REAL[i]
      field_in_k_space_TOTAL[i].imag = field_in_k_space_IMAGINARY[i]
  </code></pre>