Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pl.col(col).last() example shows both "max" and "last" behaviour #17826

Closed
DeflateAwning opened this issue Jul 23, 2024 · 1 comment · Fixed by #17962
Closed

pl.col(col).last() example shows both "max" and "last" behaviour #17826

DeflateAwning opened this issue Jul 23, 2024 · 1 comment · Fixed by #17962
Labels
accepted Ready for implementation documentation Improvements or additions to documentation P-low Priority: low

Comments

@DeflateAwning
Copy link
Contributor

Description

The pl.col(col).last() example shows both "max" and "last" behaviour. In some tools (e.g., Power BI DAX), LAST() actually means "max non-null value" (which is insane). It would be helpful to show an example where the values are [1, 3, 2], and show that .last() gets 2 (the final value in the list, as ordered at runtime), instead of the maximum value.

Link

https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.last.html#polars.Expr.last

@DeflateAwning DeflateAwning added the documentation Improvements or additions to documentation label Jul 23, 2024
@orlp
Copy link
Collaborator

orlp commented Jul 26, 2024

Feel free to make a pull request to update the docs.

The same also needs to be done to polars.Expr.arr.last and polars.LazyFrame.last from a quick scan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation documentation Improvements or additions to documentation P-low Priority: low
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants