del df.loc 1

del df.loc

df.drop(df.loc[df.time< df.time.shift()].index, inplace=True)

Here is what the above code is Doing:
1. We are creating a new column called 'time_diff' which is the difference between the current row and the previous row.
2. We are then dropping all rows where the time_diff is negative.

Similar Posts