etna
etna copied to clipboard
Make `TSDataset` slice return `TSDataset`
🚀 Feature Request
Now the slice form TSDataset should also be TSDataset
Proposal
- Change current behaviour of
__getitem__
,head
,tail
methods -- now it should return the corresponding TSDataset - Method
__getitem__
should work using the following rules:
- If 1 item -- [timestamp]
- If 2 items -- [timestamp, feature]
- If 3 items -- [timestamp, segment, feature]
- timestamp = int, str, slice[int], slice[str]
- segment/feature = str, list[str] or ":"
- Remove methods
loc
,tsdataset_idx_slice
- Fix all the places, where the slice of dataset is used including notebooks
- Improve the existing tests
Test cases
- Method
head(10)
works the same asts[-10:]
- Method
tail(10)
works the same asts[:10]
- Test all the possible cases of
__getitem__
Additional context
No response