Skip to content

CLN: Replace _obj_with_exclusions with _select_obj for Series #49136

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
merged 1 commit into from
Oct 17, 2022
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _wrap_agged_manager(self, mgr: Manager) -> Series:
return ser

def _get_data_to_aggregate(self) -> SingleManager:
ser = self._obj_with_exclusions
ser = self._selected_obj
single = ser._mgr
return single

Expand Down Expand Up @@ -906,7 +906,7 @@ def nlargest(
self, n: int = 5, keep: Literal["first", "last", "all"] = "first"
) -> Series:
f = partial(Series.nlargest, n=n, keep=keep)
data = self._obj_with_exclusions
data = self._selected_obj
# Don't change behavior if result index happens to be the same, i.e.
# already ordered and n >= all group sizes.
result = self._python_apply_general(f, data, not_indexed_same=True)
Expand All @@ -917,7 +917,7 @@ def nsmallest(
self, n: int = 5, keep: Literal["first", "last", "all"] = "first"
) -> Series:
f = partial(Series.nsmallest, n=n, keep=keep)
data = self._obj_with_exclusions
data = self._selected_obj
# Don't change behavior if result index happens to be the same, i.e.
# already ordered and n >= all group sizes.
result = self._python_apply_general(f, data, not_indexed_same=True)
Expand Down