Pandas Should Go Extinct

33 points by ohrv


david_chisnall

I think the problem with this is the framing:

People typically start with Excel and graduate to Pandas somewhere in the GB range.

Most of the things I use Pandas for would easily fit in an Excel table but Pandas lets me iterate different analyses more quickly. A lot of Pandas users use it via Jupyter Notebooks, where the data is of a size that can fit in a clipboard for pasting into a cell.

I think the largest thing I’ve processed with Pandas was around 100 MiB (long run of an experiment that spat out a TSV as it ran).

The motivation for better performance simply isn’t there for any of these use cases. If you’re processing GiBs of data then you’re in a very different domain from, I would guess, most Pandas users.

So then the question I have for that domain is: where is the bottleneck? Is how Pandas manages data slow? Is NumPy slow? Is CPython adding overhead? If it’s the first, is this constrained by Pandas’ APIs or is it something that could be optimised without changing any consumers? If it’s the second, what happens if you switch in one of the GPU-offload NumPy variants? If it’s the last, what happens if you use a Python JIT instead? All of these can be explored without changing user code.

For people like me, who have been considering trying Polars for a while: is the Polars API better than Pandas? Is it more consistent? More concise? Less error-prone? Show me those things and you’ll convince me. Tell me that if I had 100x as much data as I have then Pandas would be slow and I’ll shrug.

stig

As a friend & colleague remarked years ago:

We don’t have big data, we just have slow queries.

gcarvalho

At the point where you start downloading the dataset in order to compute, none of these single node alternatives are nice to work with anymore. Sending the query and getting back the results becomes more practical. Spark just happens to have a more mature story for that (and plenty of cloud offerings).

You’re not gaining much by switching from pandas to polars to scan a bucket with thousands small CSV files, no matter which side of the data size “cliff” you’re on.

I have high hopes for DuckDB and DuckLake bridging this gap, however. Even though I’d rather not review stringified SQL in Python ever again.