towhee.dataframe.iterators.WindowIterator¶
- class towhee.dataframe.iterators.WindowIterator(df: DataFrame, start: int = 0, window_size: int = 1, step: Optional[int] = None, use_timestamp: bool = False, block: bool = True)[source]¶
Bases:
DataFrameIterator
A row-based window DataFrame iterator.
- Parameters:
df (towhee.Dataframe) – The dataframe that is being iterated.
start (int) – Where to start the window from.
window_size (int) – How large of a window.
step (int) – How far to iterate window per read.
use_timestamp (bool) – Whether to use timestamp instead of row_id.
block (bool) – Whether to block when data not present.
Methods
Remove unblock and remove iterator.
Attributes
Returns current accessible data size.
Returns the current index.
Returns the df name.
id
- __init__(df: DataFrame, start: int = 0, window_size: int = 1, step: Optional[int] = None, use_timestamp: bool = False, block: bool = True)[source]¶
- property accessible_size: int¶
Returns current accessible data size.
- property current_index: int¶
Returns the current index.
- property df_name: str¶
Returns the df name.
- notify()¶
Remove unblock and remove iterator.