-
Notifications
You must be signed in to change notification settings - Fork 77
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
fix: fixing unnesscary raise of mean_horizontal #1082
Conversation
mean_horizontal was implemented in Polars 0.20.8: https://github.com/pola-rs/polars/releases/tag/py-0.20.8 I found the implementation in Narwhals and it seems need an update as well, will do that in a commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Cheukting thanks for addressing this!
Probably it's an obsession of mine, but can we keep using generator comprehensions instead of list and for loops?
All checks have passed @MarcoGorelli ship it! (What cute animal do we have time?) @FBruzzesi are you sure you want me to refactor them? Because in the for loop there is already a list comprehension, it will become a list comprehension within a list comprehension... it will not be very readable (IMHO)... here is a preview example:
I can refactor with no problem if it is preferred. Just wanna double check. |
Hey hey @Cheukting
Awesome! I will let Marco pick animal(s) π
I did the same in #1090: series = (s for _expr in parsed_exprs for s in _expr._call(df)) I know it is nested, but I believe it is still very readable for anyone who has some python experience. Actually I think this PR should take #1090 into account and set - output_names=parsed_exprs[0]._output_names,
+ output_names=reduce_output_names(parsed_exprs), in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What type of PR is this? (check all applicable)
Related issues
nw.mean_horizontal(nw.all())
raises unnecessarilyΒ #1081nw.mean_horizontal(nw.all())
raises unnecessarilyΒ #1081Checklist
If you have comments or can explain your changes, please do so below.
See #1081