[NumPy-Tickets] [NumPy] #1424: Results of array.tofile and fromfile are different
NumPy Trac
numpy-tickets@scipy....
Sun Mar 7 14:12:59 CST 2010
#1424: Results of array.tofile and fromfile are different
-----------------------------+----------------------------------------------
Reporter: HyunchulKim | Owner: somebody
Type: defect | Status: closed
Priority: highest | Milestone:
Component: numpy.numarray | Version: 1.3.0
Resolution: invalid | Keywords: tofile, fromfile
-----------------------------+----------------------------------------------
Changes (by charris):
* status: new => closed
* resolution: => invalid
Comment:
You need to specify the dtype when using fromfile:
{{{
In [1]: x = array([0,1,2,3])
In [2]: x.tofile("foo.dat")
In [3]: y = fromfile("foo.dat", dtype=x.dtype)
In [4]: x == y
Out[4]: array([ True, True, True, True], dtype=bool)
}}}
The load and save routines are safer for this sort of thing.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1424#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list