-
Notifications
You must be signed in to change notification settings - Fork 952
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using prepend_values
the component names are lost.
To Reproduce
import numpy as np
from darts import concatenate
from darts.utils.timeseries_generation import linear_timeseries
series1 = linear_timeseries(start_value=1, end_value=2, start=0, length=10, freq=2, column_name='A')
series2 = linear_timeseries(start_value=2, end_value=3, start=0, length=10, freq=2, column_name='B')
series = concatenate([series1, series2], axis=1)
series.columns # returns Index(['A', 'B'], dtype='object', name='component')
prepended = series.prepend_values(np.array([[1, 2], [1, 2]]))
prepended.columns # returns Index(['0', '1'], dtype='object', name='component')
Expected behavior
prepended.columns
should be the same as series.columns
.
Additional context
This issue does not happen when append_values
is used.
appended = series.append_values(np.array([[1, 2], [1, 2]]))
appended.columns # returns Index(['A', 'B'], dtype='object', name='component')
Probably it's enough to add columns=self.columns
here: https://github.com/unit8co/darts/blob/master/darts/timeseries.py#L2875.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Released