diff --git a/modin/pandas/groupby.py b/modin/pandas/groupby.py index 2f6a5752295..8395dbc7bb8 100644 --- a/modin/pandas/groupby.py +++ b/modin/pandas/groupby.py @@ -1434,6 +1434,32 @@ def _iter(self): for k in (sorted(group_ids) if self._sort else group_ids) ) + def unique(self): + return self._check_index( + self._wrap_aggregation( + type(self._query_compiler).groupby_unique, + numeric_only=False, + ) + ) + + def nlargest(self, n=5, keep="first"): + return self._check_index( + self._wrap_aggregation( + type(self._query_compiler).groupby_nlargest, + agg_kwargs=dict(n=n, keep=keep), + numeric_only=True, + ) + ) + + def nsmallest(self, n=5, keep="first"): + return self._check_index( + self._wrap_aggregation( + type(self._query_compiler).groupby_nsmallest, + agg_kwargs=dict(n=n, keep=keep), + numeric_only=True, + ) + ) + def value_counts( self, normalize: bool = False,