[SciPy-user] rescuing old pickled numpy arrays

Cory Davis cdavis at staffmail.ed.ac.uk
Tue Jun 20 05:56:39 CDT 2006


Thanks for the advice David,
here is an example pickle that produces the error below.  I think its 
just a dictionary with some arrays.
Cheers,
Cory.

David M. Cooke wrote:
> On Mon, Jun 19, 2006 at 02:51:36PM +0100, Cory Davis wrote:
> 
>>Hi All,
>>this relates to a question I raised a few weeks ago about pickled arrays 
>>from older Numpy versions not loading.  Here is what happens when I try 
>>to load my old data ...
>>
>>---> 51     return cPickle.load(infile)
>>
>>AttributeError: 'module' object has no attribute 'dtypedescr'
>>
>>Can anyone suggest an easy way to rescue this data?
> 
> 
> The easy way I suppose would be to inject a 'dtypedescr' into the
> appropiate module.
> 
> Have a look at the pickletools module. pickletools.dis() will
> disassemble the pickle, so you could figure out what it's looking for.
> 
> At worst, you could use pickletools.genops() to pull out the data.
> 
> Can you send me a copy of a pickle? I may be able to cook up an upgrade
> routine.
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: results_taubar_ar3.pickle
Url: http://www.scipy.net/pipermail/scipy-user/attachments/20060620/0d545492/results_taubar_ar3.bat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cdavis.vcf
Type: text/x-vcard
Size: 431 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20060620/0d545492/cdavis.vcf


More information about the SciPy-user mailing list