pandas select first n rows of a column code example Example: print last n rows of dataframe df1.tail(n)