[SciPy-User] scikits.timeseries: setting values outside of existing series range

Pierre GM pgmdevlist@gmail....
Wed Apr 14 14:58:54 CDT 2010

On Apr 14, 2010, at 2:53 PM, Abiel X Reinhart wrote:
> What is the best way to set particular indices of a TimeSeries to new values, where the indices in question are not already contained in the TimeSeries? For example, I might have an annual series running from 2000 to 2005, and I want to insert a lone value for 2009.  

I'm not sure I see what you mean, could you provide an actual example ?
If you want to add a single value to an existing series, create a new 1-element series for this value and use ts.concatenate to join the two.
If you want to change both the date and value of a particular entry, things get tricky: you could modify the value by simple indexing (like a[-1]) but you'd have to modify explicitly the date as well. I would recommend caution in that case, as you could break things rather easily. It's better to create a new series.
HIH, but don't hesitate to ask if you need more info

More information about the SciPy-User mailing list