Pandas Series provides two very useful methods for extracting the data from the top and bottom of the Series Object. These methods are **head()** and **tail()**.

**head() Method**

**head()**method is used to get the elements from the top of the series. By default, it gives 5 elements.

**Syntax:**

**Example:**

**S**.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import pandas as pd s = pd.Series({'A':1,'B':2,'C':3,'D':4,'E':5,'F':6,'G':7,'H':8}) print(s) |

### head() Function without argument

1 2 3 4 5 6 7 8 9 | s.head() |

### head() Function with Positive Argument

1 2 3 4 5 6 7 8 9 10 11 | s.head(7) |

### head() Function with Negative Argument

1 2 3 4 5 | s.head(-7) |

**tail() Method**

**tail()**method gives the elements of series from the bottom.

**Syntax:**

**Example:**

**S**.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import pandas as pd s = pd.Series({'A':1,'B':2,'C':3,'D':4,'E':5,'F':6,'G':7,'H':8}) print(s) |

### tail() function without argument

**tail()**function gives be default 5 values from the bottom of the Series Object.

1 2 3 4 5 6 7 8 9 10 | s.tail() ''' Output: D 4 E 5 F 6 G 7 H 8 dtype: int64 ''' |

### tail() function Positive argument

1 2 3 4 5 6 7 8 9 10 11 12 | s.tail(7) ''' Output: B 2 C 3 D 4 E 5 F 6 G 7 H 8 dtype: int64 ''' |

### tail() function Negative argument

1 2 3 4 5 6 | s.tail(-7) ''' Output: H 8 dtype: int64 ''' |