1 Dec 01:12
Re: scikits.timeseries question
Pierre GM <pgmdevlist <at> gmail.com>
2009-12-01 00:12:52 GMT
2009-12-01 00:12:52 GMT
On Nov 30, 2009, at 6:58 PM, Christopher Barker wrote:
> HI all,
>
> Maybe I'm missing something, but I can't seem to get this to work as I'd
> like.
I guess you're confusing DateArrays and TimeSeries. DateArrays are just arrays of dates (think a ndarray
of datetime objects, or a ndarray with a datetime64 dtype). TimeSeries are like MaskedArrays, the
combination of a ndarray of values with 2 others ndarrays: one array of booleans (the mask), one DateArray.
> I have a bunch of data that is indexed by "day since Jan 1, 2001". It
> seemed I should be able to do a DateArray like this:
>
> In [40]: import scikits.timeseries as ts
>
> In [41]: sd = ts.Date(freq='D', year=2001, month=1, day=1)
>
> In [42]: sd
> Out[42]: <D : 01-Jan-2001>
All is well here.
> In [43]: da = ts.date_array((1,2,3,4), start_date=sd)
Check the doc for date_array: the first argument can be
* an existing :class:`DateArray` object;
* a sequence of :class:`Date` objects with the same frequency;
* a sequence of :class:`datetime.datetime` objects;
* a sequence of dates in string format;
* a sequence of integers corresponding to the representation of
(Continue reading)
RSS Feed