Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataStream
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • DataType
    • User Defined Functions
    • Configuration
    • GPU Support
    • AI / LLM
  • PyFlink Common
  • API Reference
  • PyFlink DataFrame
  • DataFrame
  • pyflink.dataframe.dataframe.DataFrame.iter_rows

pyflink.dataframe.dataframe.DataFrame.iter_rows#

DataFrame.iter_rows(*, named: Literal[False] = False) → Iterator[Tuple[Any, ...]][source]#
DataFrame.iter_rows(*, named: Literal[True]) → Iterator[Dict[str, Any]]

Return an iterator over rows of the DataFrame.

This is a terminal operation that triggers execution.

Parameters:

named – If False (default), yields tuples of values. If True, yields dictionaries {column_name: value}.

Returns:

A generator that yields rows as tuples or dicts.

Example:

>>> df = pf.from_records([(1, "a"), (2, "b")], schema=["id", "name"])
>>> for row in df.iter_rows():
...     print(row)
(1, 'a')
(2, 'b')
>>> for row in df.iter_rows(named=True):
...     print(row)
{'id': 1, 'name': 'a'}
{'id': 2, 'name': 'b'}

previous

pyflink.dataframe.dataframe.DataFrame.collect

next

pyflink.dataframe.dataframe.DataFrame.iter_batches

On this page
  • DataFrame.iter_rows()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.