Skip to content

Commit

Permalink
fix futurewarning for TimeSeries.from_group_dataframe method (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisbader authored Dec 19, 2022
1 parent 705ec0b commit 0d924c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion darts/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,11 @@ def from_group_dataframe(
static_cov_cols = group_cols + static_cols

# split df by groups, and store group values and static values (static covariates)
# single elements group columns must be unpacked for same groupby() behavior across different pandas versions
splits = []
for static_cov_vals, group in df.groupby(group_cols):
for static_cov_vals, group in df.groupby(
group_cols[0] if len(group_cols) == 1 else group_cols
):
static_cov_vals = (
(static_cov_vals,)
if not isinstance(static_cov_vals, tuple)
Expand Down

0 comments on commit 0d924c8

Please sign in to comment.