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

pyflink.dataframe.dataframe.DataFrame.head#

DataFrame.head(n: int) → 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.DataFrame.offset

next

pyflink.dataframe.dataframe.DataFrame.to_table

On this page
  • DataFrame.head()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.