IndexedCycle#

class capymoa.stream.drift.IndexedCycle[source]#

Bases: object

An iterator that cycles through an iterable, returning tuples of (index, item).

Provides methods for replacing items at specific indices and resetting the cycle.

__init__(iterable)[source]#
replace_and_move_to(index, new_item)[source]#

Replaces the item at the specified index in the original data and moves it to the new position.

Raises:

ValueError: If the index is out of range.