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)]