Numeric.tostring() ?

Tom Lukasiak Tomasz_Lukasiak at Brown.EDU
Mon May 10 17:50:28 EDT 1999


Hi,
    I have found that the best way (or maybe the only way) to read a binary
image into an array is to do something like this:

f = open(filename)
data = f.read()
f.close()
dataArray = Numeric.fromstring(data, Numeric.Int16)


However, I run into trouble when I want to convert a Numeric array into a
data string, so that I could save my array as a binary image file.  This is
because there is no Numeric.tostring() method.  What is the best way to fix
this problem?

Thanks for any help.

Tom






More information about the Python-list mailing list