polars
polars copied to clipboard
feat(python, rust): add mean_horizontal expression
as discussed in #9966, implemented mean_horizontal
.
If this is the way to go, I will create separate PR's for others.
Thank you @romanovacca. Can you rebase? Then it is good to go.
Thank you @romanovacca. Can you rebase? Then it is good to go.
Done!
Whoops, we need another rebase. :')
@ritchie46 sorry for the delay. I don't think this is relevant anymore after #12492, right?
One thing I do still see is that that PR still uses the ".map(|opt_s| opt_s.map(|s| s.with_name("max")))" format, which automatically creates a column with the name, whereas iirc you mentioned you want it to take on the lefthand column name and thus leave that part out. I can do that in a new PR if you want to?
We still don't have a mean_horizontal
, so this PR is still welcome. It would be nicer though if the drive-by changes could be split into a separate PR. Mixing refactors and new features is usually a bad idea.
Hey @romanovacca
I was trying to add this but just noticed you have already implemented it.
- https://github.com/pola-rs/polars/compare/main...cmdlineluser:polars:feat-expr-mean_horizontal
From what I can tell, all that needs to change here is that df.hmean
has since been renamed to df.mean_horizontal
(And the edits to any
, all
, sum
need to be taken out.)
Superseded by #14369