-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Optional axis parameter for pl.any
, pl.Expr.any
, pl.all
, pl.Expr.all
#8503
Comments
If you do that I am scared that you need to do that for each method: |
Perhaps there should be an It would be slightly more verbose:
|
Fair point @gab23r i like @cmdlineluser ´s idea of concat_list with .arr.any or .arr.all for row-wise computations it would be more verbose that what exists today, but it would follow Polars logic and be easy to understand and the existing pl.any , pl.Expr.any, etc could work column-wise This can also fit into Polars logic that fast code should be easy to write. if someone is doing lots of row-wise computations, maybe the dataframe should be reworked / transposed / melted |
Just browsing old issues, I think |
@cmdlineluser yes it does. closing this |
Problem description
I just read a Stack Overflow answer which shows a concise way to verify equality in Polars:
https://stackoverflow.com/questions/76092263/column-and-row-wise-logical-operations-on-polars-dataframe
I like that the code is short and easy to write:
While I like the compactness of it, I feel that at first read is not very clear that
pl.Expr.any
does computations column-wise whilepl.any
does computations row-wise.I believe the clarity of Polars expressions is one of the strengths of the library.
My proposal for this:
pl.any
,pl.Expr.any
,pl.all
,pl.Expr.all
that allows to specify if the computation should be column-wise or row-wise?I believe having
pl.any
work the same way aspl.Expr.any
would be good for the predictability of the languageWhat are your thoughts?
The text was updated successfully, but these errors were encountered: