WindowedIterator¶
An iterator that emits windows of items from the original iterable.
The windows will be lists of at most max_length items. If the step size is not set, the windows will be consecutive. It is possible for the windows to not evenly divide the input sequence's length, in which case by default the last window will be shorter, unless the padding option is set to a value other than no padding, in which case the emitted windows will be padded to the desired length. If consecutive windows are used, one may use the balanced option to balance the windows in length such that the last window does not have many fewer items than the others. Version 1.0.0
Ports/Properties¶
iterable¶
Data to iterate over.
curitem¶
Current batch.
max_length¶
Maximum length of the emitted windows.
step¶
Step size between successive windows. The default is consecutive (i.e., non-overlapping) windows.
padding¶
Padding to use when windows would be shorter than the desired length. If set to no padding, then the emitted windows can be shorter than the desired length.
balanced¶
If enabled, the batches will be balanced in length if the iterable's length is not divisible by the max length. This can only be used with consecutive windows, i.e., when step is not set.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
verbose¶
Whether to print the current item to the console.