你要创建一个复数数组后才能给数组内数据复制,np要求数组内数据类型一样,
import numpy as np N=3 Y=np.arange(N)[:,None] + np.complex128('j')* np.arange(N) print(Y) Y[0][0]=1+3j print(Y)