-
Notifications
You must be signed in to change notification settings - Fork 1k
Add TimeSeries.from_polars #2635
Copy link
Copy link
Closed
Labels
feature requestUse this label to request a new featureUse this label to request a new feature
Description
Is your feature request related to a current problem? Please describe.
I was trying to use darts with Polars, but casting a Polars DataFrame into a TimeSeries hardly works.
Describe proposed solution
There are two ways of doing this:
- quick and dirty: add a
TimeSeries.from_polarsclassmethod that handles conversion with mostly custom logic (this could potentially entail deprecatingfrom_dataframeand renaming it intofrom_pandas: it's not the de facto dataframe library anymore). - Use narwhals to rewrite
TimeSeries.from_dataframeand support all dataframe backends thatnarwhalsdoes.
To give a bit of context: narwhals is a new project that's grown a lot this year. It's a very thin, zero-dependency library for developers to write dataframe-agnostic code. It's quite used: plotly 6.0 will use polars for (AFAIK) all its dataframe manipulation, and so do already libraries like altair, marimo, hierarchicalforecast by nixtla...
Glad to provide more details 😊
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestUse this label to request a new featureUse this label to request a new feature