Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For (2) I like to do:

1. `from polars import col` which at least shortens each use by a few characters 2. For columns that I use very frequently, define a "constant" for them e.g. ID=col("id").

This lets you do df.groupby(ID) instead of df.groupby(pl.col("ID")). Another advantage of defining these column "constants" is that it makes it much easier to refactor to rename all usages of the column (without needing to check whether each string "id" is being used as a column name vs. something else)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: