diff --git a/darts/timeseries.py b/darts/timeseries.py index b34848426f..b58a6cc535 100644 --- a/darts/timeseries.py +++ b/darts/timeseries.py @@ -40,6 +40,7 @@ from collections import defaultdict from copy import deepcopy from inspect import signature +from io import StringIO from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import matplotlib.axes @@ -1247,7 +1248,7 @@ def from_json( TimeSeries The time series object converted from the JSON String """ - df = pd.read_json(json_str, orient="split") + df = pd.read_json(StringIO(json_str), orient="split") return cls.from_dataframe( df, static_covariates=static_covariates, hierarchy=hierarchy )