powered by
Create an iterator that limits the specified iterable to a specified number of items.
i_limit(iterable, n, ...)
an iteror which will stop after yielding n values.
n
Iterable to iterate over.
Maximum number of values to return.
Extra arguments for iteror(iterable, ...)
iteror(iterable, ...)
Originally from the itertools package.
itertools
# Limit icount to only return three values as.list(i_limit(icount(), 3))
Run the code above in your browser using DataLab