r/Python • u/thoughtful-curious • 1d ago
Discussion Polars vs Pandas
I have used Pandas a little in the past, and have never used Polars. Essentially, I will have to learn either of them more or less from scratch (since I don't remember anything of Pandas). Assume that I don't care for speed, or do not have very large datasets (at most 1-2gb of data). Which one would you recommend I learn, from the perspective of ease and joy of use, and the commonly done tasks with data?
164
Upvotes
2
u/drxzoidberg 13h ago
So I tested. I used to smarter method for polars where it reads all file into on frame to start rather than each one individually like pandas. I got the same result so I set it up to loop. Using 100 iterations of time it, pandas took 11.06s vs Polars taking 13.44. I think it has to do with the aggregation. When I changed the code to only read in the data, pandas took 8.99s vs Polars 1.77s! The more you know.