e also :func:`groupby_transform`, which can be used with this function
    to group ranges of items with the same `bool` value.

    r