Python Polars Cheatsheet (based on our O'Reilly book)

opensource.posit.co

133 points by jeroenjanssens 7 hours ago


dalemhurley - a minute ago

Why do Python users use acronyms instead of verbose variable names?

jeroenjanssens - 7 hours ago

We spent the last few weeks compressing our book, Python Polars: The Definitive Guide (nearly 500 pages), down to a two-page cheatsheet. It's a highly lossy compression, but hopefully a useful one! Besides the PDF, there's also an accessible HTML version.

We're curious to hear what you think. Let us know if we missed any of your favorite Polars operations, or if you have any feedback on how we organized it.

wsowens - 4 hours ago

Despite writing most of my procedural code in Python, I've always preferred doing my data analysis in R. For all of R's warts, the ergonomics of the dplyr + ggplot + the rest of the tidyverse are very tough to beat. My few attempts to use Pandas and matplotlib/seaborne have always proved frustrating. Based on this cheatsheet though, it seems like Polars addresses some of the friction of Pandas. Looking forward to trying it!

paulfharrison - an hour ago

I'm sure Polars is great, but I can't get over needing 10 characters of ceremony every time I want to refer to a column in a data frame.

pl.col("...")

clircle - 7 hours ago

I get that the data science world has moved on to python, but I always felt that R's data.table had the slickest dataframe developer experience. I have toyed with Polars for a few hours, maybe I should give it a better chance.

brikym - 30 minutes ago

echo "Never use pandas, use polars instead" > AGENTS.md

mrtimo - 3 hours ago

I've moved from python/polars/pandas to DuckDB and have not looked back