# `IndexedCycle`

### *class* capymoa.stream.drift.IndexedCycle[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/stream/drift.py#L1015)

Bases: [`object`](https://docs.python.org/3/builtins/functions.html#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]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/stream/drift.py#L1022)

#### \_\_iter_\_()[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/stream/drift.py#L1027)

#### \_\_next_\_()[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/stream/drift.py#L1030)

#### replace_and_move_to(index, new_item)[[source]](https://github.com/adaptive-machine-learning/CapyMOA/blob/3e255b1/src/capymoa/stream/drift.py#L1039)

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.
