Skip to content
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

fix dataset for python38 #2065

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions darts/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,8 @@ def pre_process_dataset(dataset_path):
"""Restrict the time axis and add the weather data"""
df = pd.read_csv(dataset_path, index_col=0)
# convert time index
df.index = (
pd.DatetimeIndex(df.index, tz="CET").tz_convert("UTC").tz_localize(None)
df.index = pd.DatetimeIndex(pd.to_datetime(df.index, utc=True)).tz_localize(
None
)
# extract pre-determined period
df = df.loc[
Expand Down Expand Up @@ -914,8 +914,8 @@ def _download_weather_data():
df["param_name"] = df["Parameter"] + " [" + df["Einheit"] + "]"
df = df.pivot(index="Datum", columns="param_name", values="Wert")
# convert time index to from CET to UTC and extract the required time range
df.index = (
pd.DatetimeIndex(df.index, tz="CET").tz_convert("UTC").tz_localize(None)
df.index = pd.DatetimeIndex(pd.to_datetime(df.index, utc=True)).tz_localize(
None
)
df = df.loc[
(pd.Timestamp("2015-01-01") <= df.index)
Expand Down
Loading