diff --git a/nbs/core.ipynb b/nbs/core.ipynb index 459ed1a78..54c5de3d9 100644 --- a/nbs/core.ipynb +++ b/nbs/core.ipynb @@ -523,7 +523,7 @@ "\n", " # Declare predictions pd.DataFrame\n", " if df_constructor is pl_DataFrame:\n", - " fcsts = pl_DataFrame(fcsts, schema=cols)\n", + " fcsts = pl_DataFrame(dict(zip(cols, fcsts.T)))\n", " else:\n", " fcsts = pd.DataFrame(fcsts, columns=cols)\n", " fcsts_df = ufp.horizontal_concat([fcsts_df, fcsts])\n", @@ -654,7 +654,7 @@ "\n", " # Add predictions to forecasts DataFrame\n", " if isinstance(self.uids, pl_Series):\n", - " fcsts = pl_DataFrame(fcsts, schema=cols)\n", + " fcsts = pl_DataFrame(dict(zip(cols, fcsts.T)))\n", " else:\n", " fcsts = pd.DataFrame(fcsts, columns=cols)\n", " fcsts_df = ufp.horizontal_concat([fcsts_df, fcsts])\n", @@ -752,7 +752,7 @@ "\n", " # Add predictions to forecasts DataFrame\n", " if isinstance(self.uids, pl_Series):\n", - " fcsts = pl_DataFrame(fcsts, schema=cols)\n", + " fcsts = pl_DataFrame(dict(zip(cols, fcsts.T)))\n", " Y_df = pl_DataFrame(original_y)\n", " else:\n", " fcsts = pd.DataFrame(fcsts, columns=cols)\n", diff --git a/neuralforecast/core.py b/neuralforecast/core.py index ab136fcb4..87d39796e 100644 --- a/neuralforecast/core.py +++ b/neuralforecast/core.py @@ -443,7 +443,7 @@ def predict( # Declare predictions pd.DataFrame if df_constructor is pl_DataFrame: - fcsts = pl_DataFrame(fcsts, schema=cols) + fcsts = pl_DataFrame(dict(zip(cols, fcsts.T))) else: fcsts = pd.DataFrame(fcsts, columns=cols) fcsts_df = ufp.horizontal_concat([fcsts_df, fcsts]) @@ -582,7 +582,7 @@ def cross_validation( # Add predictions to forecasts DataFrame if isinstance(self.uids, pl_Series): - fcsts = pl_DataFrame(fcsts, schema=cols) + fcsts = pl_DataFrame(dict(zip(cols, fcsts.T))) else: fcsts = pd.DataFrame(fcsts, columns=cols) fcsts_df = ufp.horizontal_concat([fcsts_df, fcsts]) @@ -688,7 +688,7 @@ def predict_insample(self, step_size: int = 1): # Add predictions to forecasts DataFrame if isinstance(self.uids, pl_Series): - fcsts = pl_DataFrame(fcsts, schema=cols) + fcsts = pl_DataFrame(dict(zip(cols, fcsts.T))) Y_df = pl_DataFrame(original_y) else: fcsts = pd.DataFrame(fcsts, columns=cols)