D
Duncan Smith
I am having problems saving arrays to file. e.g.
[ 0, 0, 0, 5, 0, 0]])
final element
Traceback (most recent call last):
File "<pyshell#181>", line 1, in -toplevel-
Numeric.fromstring(f.readline().strip())
ValueError: string size must be a multiple of element size
Anyone any idea where I'm going wrong? 2.3 on Win2k. Cheers.
Duncan
array([[ 0, 5, 10, 5, 0, 10],t1 array([30])
t2 array([ 0, 0, 5, 5, 5, 10])
t3 array([20, 5])
t4
[ 0, 0, 0, 5, 0, 0]])
array([0, 0, 5, 5, 5]) # missingf = file('c:\Data\IS_rounded.txt', 'w')
f.write(t1.tostring() + '\n')
f.write(t2.tostring() + '\n')
f.write(t3.tostring() + '\n')
f.write(t4.tostring() + '\n')
f.close()
f = file('c:\Data\IS_rounded.txt', 'r')
Numeric.fromstring(f.readline().strip()) array([30])
Numeric.fromstring(f.readline().strip())
final element
Traceback (most recent call last):
File "<pyshell#181>", line 1, in -toplevel-
Numeric.fromstring(f.readline().strip())
ValueError: string size must be a multiple of element size
Anyone any idea where I'm going wrong? 2.3 on Win2k. Cheers.
Duncan