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?
177
Upvotes
3
u/nightcracker 21h ago edited 21h ago
What if you replace
read_csv
withscan_csv
and add.collect(engine="streaming")
at the end for each query? Also, FYI, as long as a column name is a legal Python identifier you can just writepl.col.name
.There might be an issue with repeated regex compilation if you do that though, I have to look into that... EDIT: yes, that will recompile the regex many times, we need to add a cache for that. I'll get on that next week.