TimeSeries.jl
TimeSeries.jl copied to clipboard
Mutating time series
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:
- Add new columns (reallocating the backing array)
- Map a column, replacing it with its result. This would especially be useful for, e.g.,
NaNremoval
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?
Add new columns (reallocating the backing array)
I think merge or hcat already done this? IIRC, these functions do copy.
shall we have setindex(ta, column, name) to update/insert a column?
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.