I am trying to calculate the time difference between two lines using shift() , but I am getting an unexpected error. Perhaps I will miss something obvious.
df['Delta'] = (df.index - df.index.shift(1))
This statement creates a ValueError: Cannot shift with no offset . What am I missing?
source share