[SciPy-User] Saving Complex Numbers

cfrazer at uci.edu cfrazer at uci.edu
Thu Jul 8 13:34:28 EDT 2010


I'm looking to save complex number to a text file. My code is failing me
miserably. Here's a simpler case of my problem:

Code:

---------------------------------
from numpy import *
from pylab import *


a = [3+2j,5+7j,8+2j]
savetxt("complex.out",a)
---------------------------------

SavedFile:

---------------------------------
3.000000000000000000e+00
5.000000000000000000e+00
8.000000000000000000e+00
---------------------------------


Need Complex numbers in the saved file.

Thanks in advance!
-Chris Frazer




More information about the SciPy-User mailing list