10000 BUG/PERF: groupby.transform with unobserved categories by undermyumbrella1 · Pull Request #58084 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG/PERF: groupby.transform with unobserved categories #58084

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

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move orig_obj arg in constructor to last param, to account for possib…
…le empty param
  • Loading branch information
Kei committed Apr 17, 2024
commit baa1b284b9e64afc60ea711982d31fdbf6b69ca6
2 changes: 1 addition & 1 deletion pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2048,7 +2048,6 @@ def _gotitem(self, key, ndim: int, subset=None):
orig_obj = self.orig_obj if not self.observed else None
return SeriesGroupBy(
subset,
orig_obj,
self.keys,
level=self.level,
grouper=self._grouper,
Expand All @@ -2059,6 +2058,7 @@ def _gotitem(self, key, ndim: int, subset=None):
group_keys=self.group_keys,
observed=self.observed,
dropna=self.dropna,
orig_obj=orig_obj,
)

raise AssertionError("invalid ndim for _gotitem")
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,6 @@ class GroupBy(BaseGroupBy[NDFrameT]):
def __init__(
self,
obj: NDFrameT,
orig_obj: NDFrameT | None = None,
keys: _KeysArgType | None = None,
level: IndexLabel | None = None,
grouper: ops.BaseGrouper | None = None,
Expand All @@ -1108,6 +1107,7 @@ def __init__(
group_keys: bool = True,
observed: bool = False,
dropna: bool = True,
orig_obj: NDFrameT | None = None,
) -> None:
self._selection = selection

Expand Down
0