Skip to content

Commit

Permalink
[FIX] Polars .columns produces list rather than Pandas Index (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
akmalsoliev authored Jan 17, 2024
1 parent ddb03b0 commit e075ab8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion nbs/tsdataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@
"\n",
" # Static features\n",
" if static_df is not None:\n",
" static_cols = static_df.columns.drop(id_col)\n",
" static_cols = [col for col in static_df.columns if col != id_col]\n",
" static = ufp.to_numpy(static_df[static_cols])\n",
" static_cols = pd.Index(static_cols)\n",
" else:\n",
" static = None\n",
" static_cols = None\n",
Expand Down
3 changes: 2 additions & 1 deletion neuralforecast/tsdataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,9 @@ def from_df(

# Static features
if static_df is not None:
static_cols = static_df.columns.drop(id_col)
static_cols = [col for col in static_df.columns if col != id_col]
static = ufp.to_numpy(static_df[static_cols])
static_cols = pd.Index(static_cols)
else:
static = None
static_cols = None
Expand Down

0 comments on commit e075ab8

Please sign in to comment.