w3resource

Pandas Series: head() function

Get the first n rows in Pandas series

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

Syntax:

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

Parameters:

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

Returns: obj_head - same type as caller

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

Example:


Download the above Notebook from here.



Inviting useful, relevant, well-written and unique guest posts