[Numpy-discussion] Numeric - fromfile ?
alexandre.fayolle at logilab.fr
Tue Aug 23 00:16:10 EDT 2005
On Mon, Aug 22, 2005 at 01:27:55PM -0400, Hari Sundar wrote:
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: Digital signature
More information about the NumPy-Discussion