You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 deprecating from_dataframe and renaming it into from_pandas: it's not the de facto dataframe library anymore).
Use narwhals to rewrite TimeSeries.from_dataframe and support all dataframe backends that narwhals 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 😊
The text was updated successfully, but these errors were encountered:
I really like the idea of re-implementing from_dataframe using narwahls so that darts can support both pandas and polars, it should not be too difficult... Let's see what @dennisbader thinks about it!
If this feature request makes it to the roadmap, would you have the time to contribute and open a PR for it?
Ciao @madtoinou, thanks for the prompt reply! I would love to, but not sure if I have time this month. However, I am sure that @FBruzzesi and @MarcoGorelli might help (me) out - they are usually always available for narwhalification 🦄
On the implementation detail side, I guess the signature of the function could and should stay the same, am I right?
Thanks for this feature request @baggiponte. I like the idea of adding support for polars (and others) to our factory methods.
I quickly checked out narwhals and it definitely looks interesting.
Just to clarify that we're all on the same page: We only want to add support for converting polars, ... DataFrames into TimeSeries (meaning xarray). So the TimeSeries itself will not run e.g. on polars for downstream tasks.
Solution 2. seems like a nice solution for me if we can guarantee that the performance doesn't suffer for the pandas support.
If we do that, then we could also add support for other methods:
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:
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).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 😊
The text was updated successfully, but these errors were encountered: