-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
make grouping column an agg #6997
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
Conversation
@@ -955,7 +964,14 @@ def _python_agg_general(self, func, *args, **kwargs): | |||
for name, obj in self._iterate_slices(): | |||
try: | |||
result, counts = self.grouper.agg_series(obj, f) | |||
output[name] = self._try_cast(result, obj) | |||
|
|||
if _dtype is None: # infer old dytpe |
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.
why is all this necessary? _try_cast
does this IIRC
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.
it looks like agg must upcast to float, i can't recall tbh... also my choice of api is not good.
I'm not even using it, so er... guess I should remove.
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.
ah yes, it upcast to float... this explains the "wip" commit message
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.
ok but try_cast should still be able to fix it maybe it needs more hints)
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.
I can take this - u can lot on plate!
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.
that would be amazing, thanks! This was also attempting to address #6594 btw, looks like ohlc in there twice.
closing in favor of #7000 |
fixes #5610