JuliaStats / TimeSeries.jl

Time series toolkit for Julia
Other
352 stars 69 forks source link

Mutating time series #457

Open imbrem opened 4 years ago

imbrem commented 4 years ago

While I understand the point of disallowing inserting new data points into the middle of a time series (which is immutable), since we already support update and rename!, I think it may be helpful to have functions which:

Potentially, we could also support filter! to filter a TimeArray in place, as this would not add any date points and would not affect the fact that the TimeArray is sorted. Thoughts?

iblislin commented 4 years ago

Add new columns (reallocating the backing array)

I think merge or hcat already done this? IIRC, these functions do copy.

clouds56 commented 3 years ago

shall we have setindex(ta, column, name) to update/insert a column?

iblislin commented 3 years ago

There is a plan for adding a dynamic length type: https://github.com/JuliaStats/TimeSeries.jl/issues/482#issuecomment-777379241 So that new type can serve for insert/delete columns.

About update: the inplaced update operations are fine for a static length TimeArray. I think it's okay to just add setindex!(ta, ::Vector, name::Symbol) for it.