I have two arrays, field_in_k_space_REAL and field_in_k_space_IMAGINARY, that contain, respectively, the real and imaginary parts of an array of complex numbers, field_in_k_space_TOTAL, which I would like to create. Why does the following assignment not work, producing the error
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]