def chunks(l, n):
    """Generator that splits a list into equal peices of length n

    Parameters
    ----------
    l: Array-like
        Array to be split
    n: Integer
        Length of each sub array
    """
    for i in range(0, len(l), n):
        yield l[i:i + n]
