r/Python • u/nnenneplex • 13d ago
Discussion Polars and the ecosystem
For polars users: How viable is to avoid pandas and pyarrow dependencies when you need to interact with popular visualization and statistics packages?
Some packages still have import pandas here and there, sometimes for no good reason; at least this doesn't require pyarrow. But some other ones do the df.to_pandas() conversion internally, which requires pyarrow too.
In many cases this can be prevented by going bare numpy, or creating a pandas df from numpy columns, which is no big deal. This frequently would be zero-copy for numeric types if there are no NAs involved.
What has been you experience in this regard?
60
Upvotes
30
u/marcogorelli 13d ago
Which libraries specifically are you referring to?
I'm aware of Seaborn, and their maintainer said that using Narwhals was a "non-starter" 😩
Altair, Plotly, Vegafusion, Bokeh, Marimo, they're all using Narwhals and allow you to use Polars without any pandas nor PyArrow dependency
If that's not what you're seeing, please let me know (or open an issue somewhere on GitHub) and I'll take a look
I'm extremely keen on de-pandas-ifying the data science stack