Skip to content

Timeseries Intervals to Mask Primitive #186

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

Closed
csala opened this issue Jul 12, 2019 · 0 comments · Fixed by #189
Closed

Timeseries Intervals to Mask Primitive #186

csala opened this issue Jul 12, 2019 · 0 comments · Fixed by #189
Labels
approved The issue is approved and someone can start working on it new primitives A new primitive is being requested
Milestone

Comments

@csala
Copy link
Contributor

csala commented Jul 12, 2019

Build a new primitive that takes as input an ordered index and a set of intervals and builds a mask with the same length as the index with boolean values indicating whether each value is within any of the given intervals or not.

As this is a very simple primitive, it can be directly put inside the custom.timeseries_preprocessing module.

The behavior should be something along this lines:

>>> index = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> intervals = [[3, 5], [7, 10]]
>>> intervals_to_mask(index, intervals)
array([False, False, False,  True,  True,  True, False,  True,  True,
        True])

Inputs should be called index and intervals and output should be called mask.
All types should be numpy.ndarray, even though the implementation can be made to support any kind of array-like object.

@csala csala added new primitives A new primitive is being requested approved The issue is approved and someone can start working on it labels Jul 12, 2019
@csala csala added this to the 0.2.1 milestone Jul 12, 2019
@csala csala closed this as completed in #189 Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved The issue is approved and someone can start working on it new primitives A new primitive is being requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant