News for hackers. Stuff that matters.
Re:Pandas v2.0 Released by alphanullmeric on Monday April 03, 2023 @01:14PM (#35427588)
Too bad polars like everything else written in rust has horrible ergonomics. I don’t know how anyone can look at the polars rust API and say in good faith that not having default arguments and named parameters was a good idea.
Re:Pandas v2.0 Released by wenc on Monday April 03, 2023 @01:39PM (#35428053)
* * *
Re:Pandas v2.0 Released by detrites on Monday April 03, 2023 @02:52PM (#35429341)
Do you happen to know if this can be used as more or less a drop-in replace for pandas in Python? (Presuming, I suppose data conversion prior.)
Re:Pandas v2.0 Released by wenc on Monday April 03, 2023 @03:42PM (#35430116)
It depends on what you do with Pandas. The semantics are different so you’ll have to rewrite stuff — that said, for me it was worth it for the most part because I work with massive columnar data in Parquet.

So no, not a drop in replacement. But not a difficult transition either.

This page explains how Polars differs from Pandas.

https://pola-rs.github.io/polars-book/user-guide/coming_from...

Re:Pandas v2.0 Released by valarauko on Monday April 03, 2023 @04:39PM (#35430936)
As someone who loathes the Pandas syntax and lusts for the relatively cleaner tidyverse code of my colleagues, the Polar syntax just feels ... off (from the link):

df.with_columns( pl.when(pl.col("c") == 2) .then(pl.col("b")) .otherwise(pl.col("a")).alias("a") )

Seeing the multiple nested pl calls within a single expression just feels odd to me. It's definitely reminiscent of Dplyr but in a much less elegant way.

Re:Pandas v2.0 Released by dunefox on Monday April 03, 2023 @05:21PM (#35431459)
Yeah, I tried to get into it but it seems very verbose.
Re:Pandas v2.0 Released by wenc on Monday April 03, 2023 @05:39PM (#35431662)
* * *
Re:Pandas v2.0 Released by valarauko on Monday April 03, 2023 @06:39PM (#35432334)
I like the idea of Polars, and it's on my list of things to try. Unfortunately, my current codebase in heavily tied to Pandas (bioinformatics tools that use Pandas as a dependency). I also deal mostly in sparse matrices which I'm unsure if duckdb handles.

Another caveat for me is at multiple times in my workflow I drop into R for plots and rpy2 can convert pandas dataframes into equivalent R atomics. With Polars it would be just an additional step of converting to pandas df but just something I need to consider. That said, I've disliked the Pandas syntax for so long that the mental overhead might be well worth it.

Re:Pandas v2.0 Released by detrites on Monday April 03, 2023 @04:55PM (#35431160)
Thank you, that is definitely the page for me.
Re:Pandas v2.0 Released by aguspdana on Monday April 03, 2023 @01:20PM (#35427707)
I agree that the Rust API is still rough. But..

Polars has Python API. It's much nicer than the Rust API. Plus the documentation is more complete.

Re:Pandas v2.0 Released by Laiho on Monday April 03, 2023 @01:41PM (#35428081)
Couldn't agree more about the rust API. Python API seems OK. Found it very complicated to use and just clunky in general.