dataframe last row code example
Example 1: drop last row pandas
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)
df.drop(df.tail(n).index,inplace=True) # drop last n rows
rows = df.iloc[-2:]
df1.tail(n)