[Numpy-discussion] portability issue

pbtransfert at freesurf.fr pbtransfert at freesurf.fr
Wed Aug 31 00:08:08 EDT 2005


hi !

i try to transfer a pickle which contains numeric array, from a 64-bits
system to a 32-bits system. it seems to fail due to bad (or lack of)
conversion... more precisely, here is what i do on the 64-bits system :

import Numeric,cPickle
a=Numeric.array([1,2,3])
f=open('test.pickle64','w')
cPickle.dump(a,f)
f.close()

and here is what i try to do on the 32-bits system :

import Numeric,cPickle
f=open('test.pickle64','r')
a=cPickle.load(f)
f.close()

and here is the log of the load :

    a=cPickle.load(f)
  File "/usr/lib/python2.3/site-packages/Numeric/Numeric.py", line 539, in
array_constructor
    x.shape = shape
ValueError: ('total size of new array must be unchanged', <function
array_constructor at 0x40a1002c>, ((3,), 'l',
'\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00',True))


Is there something to do to solve this difficulty ?

thanks

PB






More information about the NumPy-Discussion mailing list