pandas provides the .head() and .tail() methods to examine the first (head) or last (tail) few rows in a Series. By default, these return the first or last five rows, but this can be changed using the n parameter.
Let's examine the usage given the following Series:
![](https://static.packt-cdn.com/products/9781787123137/graphics/assets/989243f9-7ed5-4ebf-88fe-767b1db35095.png)
The following retrieves the first five rows:
![](https://static.packt-cdn.com/products/9781787123137/graphics/assets/d8330081-ee60-477f-8fe8-b26293a75950.png)
The number of items can be changed using the n parameter (or just by specifying the number):
![](https://static.packt-cdn.com/products/9781787123137/graphics/assets/044f7c9a-0f3c-498c-90f7-2aa0471362c4.png)
.tail() returns the last five rows:
![](https://static.packt-cdn.com/products/9781787123137/graphics/assets/6e038de0-39ad-48ed-92cc-65980cb3fe57.png)
It works similarly when specifying a number other than 5:
![](https://static.packt-cdn.com/products/9781787123137/graphics/assets/62f59d8c-a8ed-432e-a87d-fda67b49c8d6.png)
The .take() method returns the rows in a series at the specified integer position:
![](https://static.packt-cdn.com/products/9781787123137/graphics/assets/17f05813-8c2c-43f5-8c23-bb6642205786.png)