23 Aug
2005
23 Aug
'05
12:16 a.m.
On Mon, Aug 22, 2005 at 01:27:55PM -0400, Hari Sundar wrote:
Hi,
Is there a function similar to numarray's fromfile, to read a binary array from a file ? What is the best way to read such a file into a Numeric array.
It depends on the format of the file. If it's a pickled Numeric array, then the pickle module can read it back. Otherwise, you get to read the file (by opening it first and calling its read() method) and you can use the fromstring() function in numeric. However you need to know the type of the array and its shape. -- Alexandre Fayolle LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org