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