DataFrame.
head
Returns the first n rows.
n
Note
This method should only be used if the resulting array is expected to be small, as all the data is loaded into the driver’s memory.
n – int, default 1. Number of rows to return.
If n is greater than 1, return a list of Row. If n is 1, return a single Row.
Row
>>> df.head() Row(age=2, name='Alice') >>> df.head(1) [Row(age=2, name='Alice')]
New in version 1.3.