towhee.dataframe.iterators.BatchIterator

class towhee.dataframe.iterators.BatchIterator(df: DataFrame, batch_size: int = 1, step: int = 1, block: bool = True)[source]

Bases: MapIterator

A row-based batched map DataFrame iterator.

Parameters:
  • df (towhee.Dataframe) – The dataframe that is being iterated.

  • batch_size (int) – How many values to read.

  • step (int) – How many steps to take after each read.

  • 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, batch_size: int = 1, step: int = 1, 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.