-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TimeSeries.from_polars
#2635
Comments
Hi @baggiponte, I really like the idea of re-implementing 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 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:
What do you think? |
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: