我正在尝试通过使用
这个语句会产生一个 "ValueError: Cannot shift with no offset" 错误。我缺少了什么?
shift()
计算两行之间的时间差,但是我遇到了意外的错误。也许我漏掉了一些明显的东西。df['Delta'] = (df.index - df.index.shift(1))
这个语句会产生一个 "ValueError: Cannot shift with no offset" 错误。我缺少了什么?