Open
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_polars
classmethod that handles conversion with mostly custom logic (this could potentially entail deprecatingfrom_dataframe
and renaming it intofrom_pandas
: it's not the de facto dataframe library anymore). - Use narwhals to rewrite
TimeSeries.from_dataframe
and support all dataframe backends thatnarwhals
does.
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 😊