[NumPy-Tickets] [NumPy] #1424: Results of array.tofile and fromfile are different
NumPy Trac
numpy-tickets@scipy....
Sun Mar 7 14:04:45 CST 2010
#1424: Results of array.tofile and fromfile are different
------------------------------+---------------------------------------------
Reporter: HyunchulKim | Owner: somebody
Type: defect | Status: new
Priority: highest | Milestone:
Component: numpy.numarray | Version: 1.3.0
Keywords: tofile, fromfile |
------------------------------+---------------------------------------------
How to reproduce this bug.[[BR]]
# Environment #[[BR]]
Python 2.6.4 at Ubuntu 9.10[[BR]]
I tested both of Ubuntu providing version and source compiled version.
Both of them give same error.[[BR]]
#########
{{{
from numpy import *
''' Regardless of specific array, it always give a false result. '''
x = array([0,1,2,3])
x.tofile('test.output')
y = fromfile('test.output')
print x == y # The result is False
print y # The result is array([ 4.24399158e-314, 8.48798317e-314])
''' Interestingly, results of repeated tofile and fromfile give same
results '''
y.tofile('test.output2')
z = fromfile('test.output2')
print y == z # The result is True !!!
print z # The result is array([ 4.24399158e-314, 8.48798317e-314])
}}}
######################[[BR]]
*** I believe that this is a must and urgent bug that give false results.
***
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1424>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list