[SciPy-User] scikits.timeseries question

Robert Ferrell ferrell@diablotech....
Mon Nov 30 21:15:29 CST 2009


On Nov 30, 2009, at 6:06 PM, Pierre GM wrote:

> On Nov 30, 2009, at 7:53 PM, Robert Ferrell wrote:
>>
>> I may be misunderstanding what you are trying to do, but here's  
>> what I
>> do:
>>
>> In [68]: sd = ts.Date('d', '2001-01-01')
>>
>> In [69]: dates = ts.date_array(cumsum(ones(4)) + sd)
>>
>> In [70]: dates
>> Out[70]:
>> DateArray([02-Jan-2001, 03-Jan-2001, 04-Jan-2001, 05-Jan-2001],
>>          freq='D')
>
> The cumsum approach works only if you have irregular time steps as  
> inputs (as in 1 day after the first, 1 day after that, 3 days after  
> that...). If you have regular time steps of 1, just use arange 
> +start_date (or even just length+start_date)

Sort of.  The cumsum approach works even if the intervals are uniform,  
of course, but it may be overkill and arange may be sufficient.

In any case, I get the impression that the OP has an array of integer  
offsets generated in some other fashion entirely.



More information about the SciPy-User mailing list