def split_overlap(seq, size, overlap, is_dataframe=False):
    """(seq,int,int) => [[...],[...],...]
    Split a sequence into chunks of a specific size and overlap.
    Works also on strings!
    It is very efficient for short sequences (len(seq()) <= 100).
    Set "is_dataframe=True" to split a pandas.DataFrame 
    
    Examples:
        >>> split_overlap(seq=list(range(10)),size=3,overlap=2)
        [[0, 1, 2], [1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6], [5, 6, 7], [6, 7, 8], [7, 8, 9]]
        >>> split_overlap(seq=range(10),size=3,overlap=2)
        [range(0, 3), range(1, 4), range(2, 5), range(3, 6), range(4, 7), range(5, 8), range(6, 9), range(7, 10)]
    """
    if size < 1 or overlap < 0:
        raise ValueError('"size must be >= 1 and overlap >= 0')

    result = []

    if is_dataframe:
        while True:
            if len(seq) <= size:
                result.append(seq)
                return result
            else:
                result.append(seq.iloc[:size])
                seq = seq.iloc[size - overlap :]

    else:
        while True:
            if len(seq) <= size:
                result.append(seq)
                return result
            else:
                result.append(seq[:size])
                seq = seq[size - overlap :]