pyspark.pandas.Series.head

Series.head(n: int = 5) → pyspark.pandas.series.Series[source]

Return the first n rows.

This function returns the first n rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it.

Parameters
nInteger, default = 5
Returns
The first n rows of the caller object.

Examples

>>> df = ps.DataFrame({'animal':['alligator', 'bee', 'falcon', 'lion']})
>>> df.animal.head(2)  
0     alligator
1     bee
Name: animal, dtype: object