I'm trying to calculate the time difference between two rows using shift()
, but I get an unexpected error. I may be missing something obvious
df['Delta'] = (df.index - df.index.shift(1))
This statement produces a ValueError: Cannot shift with no offset
. What am I missing?