[SciPy-User] Pickling timeseries Dates

Robert Ferrell ferrell at diablotech.com
Thu Dec 10 22:12:17 EST 2009


On Dec 10, 2009, at 10:35 AM, Robert Ferrell wrote:

>
> On Dec 10, 2009, at 8:07 AM, Pierre GM wrote:
>
>> On Dec 10, 2009, at 9:41 AM, Robert Ferrell wrote:
>>>
>>> On Dec 10, 2009, at 7:27 AM, Pierre GM wrote:
>>>
>>>> On Dec 10, 2009, at 9:05 AM, Robert Ferrell wrote:
>>>>> IIRC, timeseries Date objects cannot be pickled.
>>>>
>>>> Unfortunately, that's true. Gonna have to fix that. However,
>>>> DateArrays and TimeSeries are pickable. You may want to put your
>>>> Date in a single-element DateArray
>>>
>>> Great hint.  I had just assumed DateArrays and TimeSeries couldn't  
>>> be
>>> pickled because Dates can't be pickled.  This makes it all much
>>> easier.  I've been str() single Date instances, which has been  
>>> working
>>> fine.  single-element DateArray is probably easier.
>>
>>
>> Note that there's a problem with pickling DateArrays: you lose the  
>> frequency at unpickling time. I gonna fix that ASAP. Pickling  
>> TimeSeries works quite fine, though (I used them a lot).
>
> Thanks for the heads up.  I can work around that pretty easily, but  
> I'll listen for the fix.
>
>

Fernando reminded me that any date scalar will trigger the pickle  
problem.  Some of my objects have Date instances stashed all over the  
place.  Converting all those to single-element DateArrays is not  
feasible.

Why can't Date instances be pickled, and how hard would it be to  
change that?

thanks,
-robert



More information about the SciPy-User mailing list