display the last 6 rows in a dataframe pandas code example Example 1: location of last row dataframe rows = df.iloc[-2:] Example 2: print last n rows of dataframe df1.tail(n)