Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutating time series #457

Open
imbrem opened this issue Jun 4, 2020 · 3 comments
Open

Mutating time series #457

imbrem opened this issue Jun 4, 2020 · 3 comments

Comments

@imbrem
Copy link

imbrem commented Jun 4, 2020

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., NaN removal

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
Copy link
Collaborator

iblislin commented Jun 6, 2020

Add new columns (reallocating the backing array)

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

@iblislin iblislin closed this as completed Jun 6, 2020
@iblislin iblislin reopened this Jun 6, 2020
@clouds56
Copy link

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

@iblislin
Copy link
Collaborator

There is a plan for adding a dynamic length type: #482 (comment)
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants