Pandas Series: head() function

Get the first n rows in Pandas series

The head() function is used to get the first n rows.


Series.head(self, n=5)
Pandas Series head image


Name Description Type/Default Value Required / Optional
n Number of rows to select int
Default Value: 5

Returns: obj_head - same type as caller

Raises:same type as caller
The first n rows of the caller object.


Download the Pandas Series Notebooks from here.

Previous: Subset initial periods of Pandas time series
Next: Get the row label of the maximum value in Pandas series

Share this Tutorial / Exercise on : Facebook and Twitter