diff --git a/pandas/core/groupby/ops.py b/pandas/core/groupby/ops.py index 3c4a22d009406..71525c8c1a223 100644 --- a/pandas/core/groupby/ops.py +++ b/pandas/core/groupby/ops.py @@ -996,9 +996,6 @@ def groups(self): } return result - def __iter__(self) -> Iterator[Hashable]: - return iter(self.groupings[0].grouping_vector) - @property def nkeys(self) -> int: # still matches len(self.groupings), but we can hard-code