get last row of dataframe code example
Example 1: drop the last row of a dataframe
df.drop(df.tail(n).index,inplace=True) # drop last n rows
Example 2: location of last row dataframe
rows = df.iloc[-2:]
Example 3: print last n rows of dataframe
df1.tail(n)