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 Creation
  • pyflink.dataframe.convert.from_records

pyflink.dataframe.convert.from_records#

from_records(data: Sequence[Sequence[Any] | Mapping[str, Any]], schema: List[str] | None = None) → DataFrame[source]#

Create a DataFrame from a sequence of records.

Parameters:
  • data – A sequence of records. Each record can be: - A sequence (tuple/list) of values - A dictionary with column names as keys

  • schema – Column names. Required when data contains sequences. Ignored when data contains dictionaries (keys become column names).

Returns:

A new DataFrame.

Example::
>>> import pyflink.dataframe as pf
>>> # From list of dicts
>>> df = pf.from_records([{"a": 1, "b": "x"}, {"a": 2, "b": "y"}])
>>> # From list of tuples with schema
>>> df = pf.from_records([(1, "x"), (2, "y")], schema=["a", "b"])

previous

pyflink.dataframe.convert.from_dict

next

Input/Output

On this page
  • from_records()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.