pyufunc.toolz_sliding_window#
- pyufunc.toolz_sliding_window(window_size, sequence)#
Return a sliding window over a sequence.
- Parameters:
window_size – Number of items per window.
sequence – Items to scan.
Note
Source package:
toolz.Source repository: pytoolz/toolz
Source document: https://toolz.readthedocs.io/en/latest/
Source license: BSD License.
Example
>>> list(toolz_sliding_window(2, [1, 2, 3])) [(1, 2), (2, 3)]
- Returns:
Sliding windows.
- Return type:
Iterable[tuple[Any, …]]