Yes — but not with range(). range(x, step) only makes equal-width bins. For custom buckets (0–250 ms, 250–500 ms, 500 ms–1 s, 1–3 s, …), build the buckets yourself via conditions and then group by that label.
Awesome, thanks! I started exploring this same method, but instead of using a separate `bucket_idx` to handle the sorting, I only used millisecond-based buckets with a mix of substring and type conversion, like this: