Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input/Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
  • PyFlink Multimodal
  • PyFlink DataStream
  • PyFlink Common

pyflink.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.head

next

pyflink.dataframe.DataFrame.iter_batches

Show Source

Created using Sphinx 4.5.0.