![](https://secure.gravatar.com/avatar/7fdc9b298a3db0dda9ab44a306959baa.jpg?s=120&d=mm&r=g)
Folks, I'd like to dump/pickle some record arrays. The pickling works, the unpickling raises a ValueError (on my version of numpy 0.9.6). (cf below). Is this already corrected in the svn version ? Thx ########################################################################### # x1 = array([21,32,14]) x2 = array(['my','first','name']) x3 = array([3.1, 4.5, 6.2]) r = rec.fromarrays([x1,x2,x3], names='id, word, number') r.dump('dumper') rb=load('dumper') --------------------------------------------------------------------------- exceptions.ValueError Traceback (most recent call last) /home/backtopop/Work/workspace-python/pyflows/src/<ipython console> /usr/lib64/python2.4/site-packages/numpy/core/numeric.py in load(file) 331 if isinstance(file, type("")): 332 file = _file(file,"rb") --> 333 return _cload(file) 334 335 # These are all essentially abbreviations /usr/lib64/python2.4/site-packages/numpy/core/_internal.py in _reconstruct(subtype, shape, dtype) 251 252 def _reconstruct(subtype, shape, dtype): --> 253 return ndarray.__new__(subtype, shape, dtype) 254 255 ValueError: ('data-type with unspecified variable length', <function _reconstruct at 0x2aaaafcf1578>, (<class 'numpy.core.records.recarray'>, (0,), 'V'))
![](https://secure.gravatar.com/avatar/edba5d5e00ba5768f2874715642837d9.jpg?s=120&d=mm&r=g)
Pierre GM wrote:
###########################################################################
I'm newbie moving from numarray and I also get this error. I tried svn records.py with the same result. Any hope in getting it fixed? The error can be reproduce from the source example: import numpy.core.records as rec r=rec.fromrecords([(456,'dbe',1.2),(2,'de',1.3)],names='col1,col2,col3') import cPickle print cPickle.loads(cPickle.dumps(r)) --------------------------------------------------------------------------- exceptions.ValueError Traceback (most recent call last) /home/jordi/temp/<ipython console> /usr/lib/python2.4/site-packages/numpy/core/_internal.py in _reconstruct(subtype, shape, dt ype) 251 252 def _reconstruct(subtype, shape, dtype): --> 253 return ndarray.__new__(subtype, shape, dtype) 254 255 ValueError: ('data-type with unspecified variable length', <function _reconstruct at 0xb78f ce64>, (<class 'numpy.core.records.recarray'>, (0,), 'V'))
![](https://secure.gravatar.com/avatar/edba5d5e00ba5768f2874715642837d9.jpg?s=120&d=mm&r=g)
Pierre GM wrote:
###########################################################################
I'm newbie moving from numarray and I also get this error. I tried svn records.py with the same result. Any hope in getting it fixed? The error can be reproduce from the source example: import numpy.core.records as rec r=rec.fromrecords([(456,'dbe',1.2),(2,'de',1.3)],names='col1,col2,col3') import cPickle print cPickle.loads(cPickle.dumps(r)) --------------------------------------------------------------------------- exceptions.ValueError Traceback (most recent call last) /home/jordi/temp/<ipython console> /usr/lib/python2.4/site-packages/numpy/core/_internal.py in _reconstruct(subtype, shape, dt ype) 251 252 def _reconstruct(subtype, shape, dtype): --> 253 return ndarray.__new__(subtype, shape, dtype) 254 255 ValueError: ('data-type with unspecified variable length', <function _reconstruct at 0xb78f ce64>, (<class 'numpy.core.records.recarray'>, (0,), 'V'))
participants (3)
-
Jordi Bofill
-
Pierre GM
-
Travis Oliphant