pandas.Series.head

pandas 3.1.1 · Series and accessors · method

Get the first n rows or values. On GroupBy the limit applies within each group.

Call syntax

Series.head(n=5)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
n Optional
Positional or keyword
Default 5
int

A positive integer returns that many leading values. A negative integer excludes that many values from the end.

Returns

same type as caller