[SciPy-User] Pickling timeseries Dates
Thu Dec 10 22:28:17 CST 2009
It also shouldn't be to hard to register a new pickle handler that takes care of the conversion to e.g. datetime for you. I'm not familiar with timeseries stuff, but wrote something similar to let me pickle slices, which I've included below - as you can see it's pretty trivial. After that you can carry on treating your date (slice) objects as though they were picklable.
return unpickleSlice, (slice.start, slice.stop, slice.step)
def unpickleSlice(start, stop, step):
return slice(start, stop, step)
copy_reg.pickle(slice, pickleSlice, unpickleSlice)
--- On Fri, 11/12/09, Pierre GM <email@example.com> wrote:
> From: Pierre GM <firstname.lastname@example.org>
> Subject: Re: [SciPy-User] Pickling timeseries Dates
> To: "SciPy Users List" <email@example.com>
> Received: Friday, 11 December, 2009, 4:37 PM
> On Dec 10, 2009, at 10:12 PM, Robert
> Ferrell wrote:
> > 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.
> And converting them to something else, like a datetime or
> even just a tuple (value,freq)
> > Why can't Date instances be pickled, and how hard
> would it be to
> > change that?
> because we never implemented it on the C side, and that'll
> depend on whether Matt Knox can do it or not.
> SciPy-User mailing list
More information about the SciPy-User