[Tutor] writing ascii files with Numeric? (original) (raw)

Jeff Peery jeffpeery at yahoo.com
Thu Jul 1 18:40:15 EDT 2004


Hello I am trying to write my Matrix to to a file in ASCII format. I created the matrix using Numeric, the shape is 600x25. here is the code that produces the error below:

filehandle = file("MyFile.txt", 'w')
filehandle.write(Matrix)
filehandle.close()

TypeError: Non-character array cannot be interpreted as character buffer.

I am assuming this means that 'Matrix' must be a character string and not a matrix. how would I go about converting an array of floats to a character string so I can print this thing to a file? Or is there a better way to do this? thanks!!!

Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tutor/attachments/20040701/d3f5dcbf/attachment.html



More information about the Tutor mailing list