def split(data, split_size):
    """Yield successive split_size-sized chunks from data (list or dataframe)."""
    if isinstance(data, list):
        for i in range(0, len(data), split_size):
            yield data[i:i + split_size]
    else:
        for i in range(0, len(data), split_size):
            yield data.iloc[i:i + split_size]
