You can use the iloc
method to select all rows except the last two and assign the result back to the dataframe:
main.py18 chars2 lines
This will select all rows from the start of the dataframe up to the second last row. These rows are then assigned back to the dataframe, effectively dropping the last two rows from the dataframe.
gistlibby LogSnag