index (pd.Index) – Index containing observations.
intervals (pd.IntervalIndex) – Intervals to group observations into.
threshold (int) – Minimum number of observations required per interval.
level (str, optional) – Level name to use if index is a MultiIndex. If None, uses the entire index.