|
|
|
|
|
by cmdlineluser
847 days ago
|
|
Nice article. In Python, I have been finding Polars nicer to use: (purchases
.filter(pl.col("amount") <= pl.col("amount").median().over("country") * 10)
.group_by("country")
.agg(total = (pl.col("amount") - pl.col("discount")).sum())
)
Not as compact as the R example but gets a bit closer compared to the pandas approach.- https://pypi.org/project/polars/ - https://github.com/pola-rs/polars/ |
|