-
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: drop_nulls
with subset of length>1
#1090
Conversation
DataFrame.drop_nulls
with subset of length>1drop_nulls
with subset of length>1
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.
thanks for spotting this
i think the issue is just that any_horizontal
should always only just return a single column, so we could do
root_names=combine_root_names(parsed_exprs),
- output_names=parsed_exprs[0]._output_names,
+ output_names=parsed_exprs[0]._output_names[:1],
)
def any_horizontal(self, *exprs: IntoPandasLikeExpr) -> PandasLikeExpr:
@@ -262,7 +262,7 @@ class PandasLikeNamespace:
depth=max(x._depth for x in parsed_exprs) + 1,
function_name="any_horizontal",
root_names=combine_root_names(parsed_exprs),
- output_names=parsed_exprs[0]._output_names,
+ output_names=parsed_exprs[0]._output_names[:1],
)
and that should fix it without needing to do other changes
Do you like: - output_names=parsed_exprs[0]._output_names,
+ output_names=(parsed_exprs[0]._output_names or [None])[:1], |
ah you're right - let's make a function then, just like we have for |
left-most?
Not sure I follow 100%. For this (horizontal) reduction I would expect to have:
|
yup, left-most, sorry :) so |
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
reuse_series_implementation
for drop_nullsΒ #1088Checklist
If you have comments or can explain your changes, please do so below.
This might not be the permanent fix to the issue, consider it as a hotfix for now