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

DataFrame.head(n: int) → pyflink.dataframe.dataframe.DataFrame[source]#

Return the first n rows as a new DataFrame.

This is a lazy transformation, equivalent to limit(n).

Parameters

n – The number of rows to return.

Returns

A new DataFrame containing at most n rows.

Example::
>>> df = pf.from_records([(i,) for i in range(10)], schema=["a"])
>>> df.head(3).collect()
[Row(a=0), Row(a=1), Row(a=2)]

previous

pyflink.dataframe.DataFrame.offset

next

pyflink.dataframe.DataFrame.iter_rows

Show Source

Created using Sphinx 4.5.0.