how to select the last row in a pandas dataframe code example Example: location of last row dataframe rows = df.iloc[-2:]