how to select the last n rows in pandas code example Example: print last n rows of dataframe df1.tail(n)