-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Bug 29764 groupby loses index name sometimes #33111
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
Changes from all commits
94b3bdb
4b20125
39825cc
d61ac2b
85ff9c8
1b765b3
1c3b16c
303e10c
cc5dca3
2d8026f
ffe4f2e
bdf9293
b750394
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2450,8 +2450,11 @@ def _get_cythonized_result( | |
grouper = self.grouper | ||
|
||
labels, _, ngroups = grouper.group_info | ||
output: Dict[base.OutputKey, np.ndarray] = {} | ||
output: Dict[Union[base.OutputKey, str], Union[np.ndarray, str]] = {} | ||
base_func = getattr(libgroupby, how) | ||
obj = self._selected_obj | ||
if isinstance(obj, DataFrame): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are you doing here? this is very odd There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function call My first idea was to check if the original object was from the type Does this answer your question? |
||
output["idx_name"] = obj.columns.name | ||
|
||
error_msg = "" | ||
for idx, obj in enumerate(self._iterate_slices()): | ||
|
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 don't like this at all, output is very well defined here and we are now using it for multiple different things.
can we just pass the index name to _wrap_aggregated_output and _wrap_transformed_output ?
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'll try to implement this today or tomorrow.
We have to change the Series code too in this case, if I remember correctly. But I can tell you more after implementing this. Thanks for the feedback,