[SciPy-User] scikits.timeseries question

Pierre GM pgmdevlist@gmail....
Mon Nov 30 19:06:44 CST 2009


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)



More information about the SciPy-User mailing list