python dataframe get value of last row code example Example: location of last row dataframe rows = df.iloc[-2:]