def split_at_indices(text, indices):
    [''.join(e[1] for e in g) for k, g in groupby(enumerate(text), key=lambda
        x: bisect_right(indices, x[0]))]
Efficiently partition a string at arbitrary index