Skip to content

Commit 334c97a

Browse files
rhshadrachnoatamir
authored andcommitted
CLN: Replace _obj_with_exclusions with _select_obj for Series (pandas-dev#49136)
1 parent 59c00ef commit 334c97a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/groupby/generic.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def _wrap_agged_manager(self, mgr: Manager) -> Series:
181181
return ser
182182

183183
def _get_data_to_aggregate(self) -> SingleManager:
184-
ser = self._obj_with_exclusions
184+
ser = self._selected_obj
185185
single = ser._mgr
186186
return single
187187

@@ -906,7 +906,7 @@ def nlargest(
906906
self, n: int = 5, keep: Literal["first", "last", "all"] = "first"
907907
) -> Series:
908908
f = partial(Series.nlargest, n=n, keep=keep)
909-
data = self._obj_with_exclusions
909+
data = self._selected_obj
910910
# Don't change behavior if result index happens to be the same, i.e.
911911
# already ordered and n >= all group sizes.
912912
result = self._python_apply_general(f, data, not_indexed_same=True)
@@ -917,7 +917,7 @@ def nsmallest(
917917
self, n: int = 5, keep: Literal["first", "last", "all"] = "first"
918918
) -> Series:
919919
f = partial(Series.nsmallest, n=n, keep=keep)
920-
data = self._obj_with_exclusions
920+
data = self._selected_obj
921921
# Don't change behavior if result index happens to be the same, i.e.
922922
# already ordered and n >= all group sizes.
923923
result = self._python_apply_general(f, data, not_indexed_same=True)

0 commit comments

Comments
 (0)