DatasetPipeline.iter_rows(*, prefetch_blocks: int = 0) Iterator[Union[ray.data.block.T, ray.data.row.TableRow]][source]#

Return a local row iterator over the data in the pipeline.

If the dataset is a tabular dataset (Arrow/Pandas blocks), dict-like mappings TableRow are yielded for each row by the iterator. If the dataset is not tabular, the raw row is yielded.


>>> import ray
>>> for i in ray.data.range(1000000).repeat(5).iter_rows(): 
...     print(i) 

Time complexity: O(1)


prefetch_blocks – The number of blocks to prefetch ahead of the current block during the scan.


A local iterator over the records in the pipeline.