我正在尝试使用计算两行之间的时差shift(),但是我收到了意外错误.我可能会遗漏一些明显的东西
shift()
df['Delta'] = (df.index - df.index.shift(1))
这句话产生了一个ValueError: Cannot shift with no offset.我错过了什么?
ValueError: Cannot shift with no offset
python pandas
pandas ×1
python ×1