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

notify

Remove unblock and remove iterator.

Attributes

accessible_size

Returns current accessible data size.

current_index

Returns the current index.

df_name

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.