【发布时间】:2013-01-21 01:23:20
【问题描述】:
我有一个包含时间戳事件的 pandas DataFrame。每个事件都有开始时间和结束时间:
start end other_vars
100 120 ...
150 151 ...
160 170 ...
200 210 ...
在 pandas 中是否有一种干净的方法来计算事件之间的时间(例如,前一个事件的 end 和本次事件的 start 之间的跨度)?
start end between other_vars
100 120 NA ...
150 151 30 ...
160 170 9 ...
200 210 30 ...
【问题讨论】:
标签: python pandas time-series