Skip to content

Commit

Permalink
Update timeseries.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fkiraly committed Jan 4, 2025
1 parent 0637c42 commit b22b128
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pytorch_forecasting/data/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1401,9 +1401,9 @@ def _to_tensor(cols, long=True):
"""
if not isinstance(cols, list) and cols not in data.columns:
return None
if isinstance(cols, list):
if len(cols) == 0:
return []
if isinstance(cols, list) and len(cols) == 0:
dtypekind = "f"
elif isinstance(cols, list): # and len(cols) > 0
dtypekind = data.dtypes[cols[0]].kind
else:
dtypekind = data.dtypes[cols].kind
Expand Down

0 comments on commit b22b128

Please sign in to comment.