ray.data.Dataset.iter_rows
ray.data.Dataset.iter_rows#
- Dataset.iter_rows(*, prefetch_blocks: int = 0) Iterable[Dict[str, Any]] [source]#
Return an iterable over the rows in this dataset.
Note
This operation will trigger execution of the lazy transformations performed on this dataset.
Examples
>>> import ray >>> for row in ray.data.range(3).iter_rows(): ... print(row) {'id': 0} {'id': 1} {'id': 2}
Time complexity: O(1)
- Parameters
prefetch_blocks – The number of blocks to prefetch ahead of the current block during the scan.
- Returns
An iterable over the rows in this dataset.