Convert from sympy.core.add.Add to numpy complex number
问题 I have this list of solutions from Sympy solver: In [49]: sol Out[49]: [-1.20258344291917 - 0.e-23*I, -0.835217129314554 + 0.e-23*I, 0.497800572233726 - 0.e-21*I] In [50]: type(sol) Out[50]: list In [51]: type(sol[0]) Out[51]: sympy.core.add.Add How can I convert this list to a numpy object with cells which are normal complex value? 回答1: You can call the builtin function complex on each element, and then pass the result to np.array() . For example, In [22]: z Out[22]: [1 + 3.5*I, 2 + 3*I, 4 -