ray.data.DataIterator.iter_rows#
- DataIterator.iter_rows() Iterable[Dict[str, Any]] [source]#
Return a local row iterable over the dataset.
If the dataset is a tabular dataset (Arrow/Pandas blocks), dicts are yielded for each row by the iterator. If the dataset is not tabular, the raw row is yielded.
Examples
>>> import ray >>> dataset = ray.data.range(10) >>> next(iter(dataset.iterator().iter_rows())) {'id': 0}
Time complexity: O(1)
- Returns:
An iterable over rows of the dataset.