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.from_records#

from_records(data: Sequence[Union[Sequence[Any], Mapping[str, Any]]], schema: Optional[List[str]] = None) → pyflink.dataframe.dataframe.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.from_dict

next

Input/Output

Show Source

Created using Sphinx 4.5.0.