Skip to content
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
12 changes: 6 additions & 6 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

import numpy as np

from pandas._libs import reduction as libreduction
from pandas._libs import (
Interval,
reduction as libreduction,
)
from pandas._typing import (
ArrayLike,
Manager,
Expand Down Expand Up @@ -652,12 +655,9 @@ def value_counts(

if is_interval_dtype(lab.dtype):
# TODO: should we do this inside II?
lab_interval = cast(Interval, lab)

# error: "ndarray" has no attribute "left"
# error: "ndarray" has no attribute "right"
sorter = np.lexsort(
(lab.left, lab.right, ids) # type: ignore[attr-defined]
)
sorter = np.lexsort((lab_interval.left, lab_interval.right, ids))
else:
sorter = np.lexsort((lab, ids))

Expand Down