python/ray/data/dataset_pipeline.py
def iter_rows(self, *, prefetch_blocks: int = 0) -> Iterator[Union[T, TableRow]]:
        """Return a local row iterator over the data in the pipeline.

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

        Examples:
            >>> import ray
            >>> for i in ray.data.range(1000000).repeat(5).iter_rows(): # doctest: +SKIP
            ...     print(i) # doctest: +SKIP

        Time complexity: O(1)

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

        Returns:
            A local iterator over the records in the pipeline.
        """

        def gen_rows() -> Iterator[Union[T, TableRow]]:
            time_start = time.perf_counter()

            for ds in self.iter_datasets():
                wait_start = time.perf_counter()
                for row in ds.iter_rows(prefetch_blocks=prefetch_blocks):
                    self._stats.iter_wait_s.add(time.perf_counter() - wait_start)
                    with self._stats.iter_user_s.timer():
                        yield row
                    wait_start = time.perf_counter()

            self._stats.iter_total_s.add(time.perf_counter() - time_start)

        return gen_rows()
Return a local row iterator over the data in the pipeline.

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

        Examples:
            >>> import ray
            >>> for i in ray.data.range(1000000).repeat(5).iter_rows(): # doctest: +SKIP
            ...     print(i) # doctest: +SKIP

        Time complexity: O(1)

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

        Returns:
            A local iterator over the records in the pipeline.
        
Return a local row iterator over the data in the pipeline.
If the dataset is a tabular dataset (Arrow/Pandas blocks), dict-like mappings
:py:class:`~ray.data.row.TableRow` are yielded for each row by the iterator.
If the dataset is not tabular, the raw row is yielded.
Return a local row iterator over the data in the pipeline . If the dataset is a tabular dataset ( Arrow / Pandas blocks ) dict - like mappings : py : class : ` ~ray . data . row . TableRow ` are yielded for each row by the iterator . If the dataset is not tabular the raw row is yielded .
def iter_rows(self, *, prefetch_blocks: int = 0) -> Iterator[Union[T, TableRow]]:
        def gen_rows() -> Iterator[Union[T, TableRow]]:
            time_start = time.perf_counter()
            for ds in self.iter_datasets():
                wait_start = time.perf_counter()
                for row in ds.iter_rows(prefetch_blocks=prefetch_blocks):
                    self._stats.iter_wait_s.add(time.perf_counter() - wait_start)
                    with self._stats.iter_user_s.timer():
                        yield row
                    wait_start = time.perf_counter()
            self._stats.iter_total_s.add(time.perf_counter() - time_start)
        return gen_rows()
def iter_rows ( self , * , prefetch_blocks : int = 0 ) -> Iterator [ Union [ T , TableRow ] ] : def gen_rows ( ) -> Iterator [ Union [ T , TableRow ] ] : time_start = time . perf_counter ( ) for ds in self . iter_datasets ( ) : wait_start = time . perf_counter ( ) for row in ds . iter_rows ( prefetch_blocks = prefetch_blocks ) : self . _stats . iter_wait_s . add ( time . perf_counter ( ) - wait_start ) with self . _stats . iter_user_s . timer ( ) : yield row wait_start = time . perf_counter ( ) self . _stats . iter_total_s . add ( time . perf_counter ( ) - time_start ) return gen_rows ( )
Return a local row iterator over the data in the pipeline.
Return a local row iterator over the data in the pipeline .
"""Return a local row iterator over the data in the pipeline.

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

        Examples:
            >>> import ray
            >>> for i in ray.data.range(1000000).repeat(5).iter_rows(): # doctest: +SKIP
            ...     print(i) # doctest: +SKIP

        Time complexity: O(1)

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

        Returns:
            A local iterator over the records in the pipeline.
        """
A local iterator over the records in the pipeline.
A local iterator over the records in the pipeline .
self
prefetch_blocks
int
The number of blocks to prefetch ahead of the
current block during the scan.
The number of blocks to prefetch ahead of the current block during the scan .
examples
>>> import ray
>>> for i in ray.data.range(1000000).repeat(5).iter_rows(): # doctest: +SKIP
print(i) # doctest: +SKIP
>>> import ray >>> for i in ray . data . range ( 1000000 ) . repeat ( 5 ) . iter_rows () : # doctest : + SKIP print ( i ) # doctest : + SKIP