aioplus.awindowed¶
- aioplus.awindowed(aiterable, /, *, n)¶
Return a sliding window of width
nover the givenaiterable.- Parameters:
aiterable (AsyncIterable of T) – An asynchronous iterable of elements to be windowed.
n (int) –
- Returns:
An asynchronous iterable yielding windows of elements.
- Return type:
AsyncIterable of tuple[T, …]
Examples
>>> aiterable = arange(23) >>> [window async for window in awindowed(aiterable, n=3)] [(0, 1, 2), (1, 2, 3), ..., (19, 20, 21), (20, 21, 22)]