get first and last of dataframe column code example Example: location of last row dataframe rows = df.iloc[-2:]