[SciPy-User] SciKits.TimeSeries, Error unpickling time series of dicts

Robert Ferrell ferrell at diablotech.com
Thu Dec 17 16:47:05 EST 2009


I get an error unpickling a time series of dicts.  I'm on OS X 10.6.

-robert

Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import scikits.timeseries as ts

In [2]: import pickle

In [3]: sD = ts.Date('d', '2009-01-01')

In [4]: dictTS = ts.time_series(dates=[sD], data=[{'a':1}])

In [5]: dp = pickle.dumps(dictTS)

In [6]: pickle.loads(dp)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call  
last)

/Users/TandG/<ipython console> in <module>()

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ 
pickle.pyc in loads(str)
    1372 def loads(str):
    1373     file = StringIO(str)
-> 1374     return Unpickler(file).load()
    1375
    1376 # Doctest


/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ 
pickle.pyc in load(self)
     856             while 1:
     857                 key = read(1)
--> 858                 dispatch[key](self)
     859         except _Stop, stopinst:
     860             return stopinst.value

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ 
pickle.pyc in load_build(self)
    1215         setstate = getattr(inst, "__setstate__", None)
    1216         if setstate:
-> 1217             setstate(state)
    1218             return
    1219         slotstate = None

/Library/Python/2.6/site-packages/scikits.timeseries-0.91.3-py2.6- 
macosx-10.6-universal.egg/scikits/timeseries/tseries.pyc in  
__setstate__(self, state)
    1303         """
    1304         (ver, shp, typ, isf, raw, msk, flv, dsh, dtm, frq,  
infodict) = state
-> 1305         MaskedArray.__setstate__(self, (ver, shp, typ, isf,  
raw, msk, flv))
    1306         _dates = self._dates
    1307         _dates.__setstate__((dsh, dtype(int_), isf, dtm))

/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6- 
macosx-10.6-universal.egg/numpy/ma/core.pyc in __setstate__(self, state)
    5321         """
    5322         (ver, shp, typ, isf, raw, msk, flv) = state
-> 5323         ndarray.__setstate__(self, (shp, typ, isf, raw))
    5324         self._mask.__setstate__((shp, make_mask_descr(typ),  
isf, msk))
    5325         self.fill_value = flv

TypeError: object pickle not returning list

In [7]:




More information about the SciPy-User mailing list