【发布时间】:2020-10-30 03:21:29
【问题描述】:
我有一个熊猫时间序列
time_series = pd.Series(data=[3,4,5], index=pd.DatetimeIndex(['2020-07-07 00:06:00.283', '2020-07-07 00:06:02.542', '2020-07-07 00:06:02.829']), name='I'))
使用 ISO 格式的 datetime 时间戳作为 index。如何获得与最后 n 秒(例如 1 秒)相对应的时间序列子集?
【问题讨论】:
-
本系列的预期输出是什么?
-
W.r.t.上面的示例和 1 秒的时间增量我希望数据对应于
'2020-07-07 00:06:02.542', '2020-07-07 00:06:02.829'。
标签: python pandas datetime time-series series