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

feat(python, rust): add mean_horizontal expression #11937

Closed
wants to merge 14 commits into from

Conversation

romanovacca
Copy link
Contributor

as discussed in #9966, implemented mean_horizontal.

If this is the way to go, I will create separate PR's for others.

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Oct 22, 2023
Copy link
Member

@ritchie46 ritchie46 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice @romanovacca, looks good. Small remark about the names.

crates/polars-ops/src/series/ops/horizontal.rs Outdated Show resolved Hide resolved
@ritchie46
Copy link
Member

Thank you @romanovacca. Can you rebase? Then it is good to go.

@romanovacca
Copy link
Contributor Author

Thank you @romanovacca. Can you rebase? Then it is good to go.

Done!

Copy link
Member

@ritchie46 ritchie46 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay here. Thanks @romanovacca

@ritchie46
Copy link
Member

Whoops, we need another rebase. :')

@romanovacca
Copy link
Contributor Author

romanovacca commented Dec 2, 2023

@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?

@stinodego
Copy link
Member

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.

@romanovacca romanovacca requested a review from c-peters as a code owner January 15, 2024 18:48
@cmdlineluser
Copy link
Contributor

Hey @romanovacca

I was trying to add this but just noticed you have already implemented it.

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.)

@stinodego
Copy link
Member

Superseded by #14369

@stinodego stinodego closed this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants