Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({'animal':['snake', 'bat', 'tiger', 'lion',
                   'fox', 'eagle', 'shark', 'dog', 'deer']})
df
Out[2]:
animal
0 snake
1 bat
2 tiger
3 lion
4 fox
5 eagle
6 shark
7 dog
8 deer

Viewing the last 5 lines

In [3]:
df.tail()
Out[3]:
animal
4 fox
5 eagle
6 shark
7 dog
8 deer

Viewing the last 4 lines:

In [4]:
df.tail(4)
Out[4]:
animal
5 eagle
6 shark
7 dog
8 deer