Hacker News new | ask | show | jobs
by erikcw 1265 days ago
I just tried polars for this first time this week. I ported a data pipeline from pandas and I was blown away by the performance yield. Function went from a 60 min runtime with pandas to ~1:30 in polars!

I’ve been using pandas for years and had no issues picking up the syntax. Can’t recommend giving it a try enough.

1 comments

By any chance were you iterating over your pandas dataframe or using .apply? I’d be surprised by any properly formatted (i.e. vectorized) pandas operation that takes that long for data that fits in memory
Here's an example of idiomatic Pandas taking 10 minutes while Polars takes 7 seconds: https://www.pola.rs/posts/the-expressions-api-in-polars-is-a...
I'm not saying that polars isn't faster. In fact in my other comment here I mention that polars is much better than pandas at what polars does (it's not a drop in replacement). I'm just saying that most of the times (not always, and in fact in those cases we've used polars to speed it up) that I've seen painfully slow pandas operations has been due to poorly formatted pandas code.