我在熊猫中有一个时间序列,如下所示:
2012-01-01 00:00:00.250000 12
2012-01-01 00:00:00.257000 34
2012-01-01 00:00:00.258000 45
2012-01-01 00:00:01.350000 56
2012-01-01 00:00:02.300000 78
2012-01-01 00:00:03.200000 89
2012-01-01 00:00:03.500000 90
2012-01-01 00:00:04.200000 12
有没有办法在不对齐 1 秒边界的情况下将其下采样到 1 秒数据?例如,有没有办法获取这些数据(假设下采样一种使用采样时间之前或采样时间发生的最新值的方式):
2012-01-01 00:00:00.250000 12
2012-01-01 00:00:01.250000 45
2012-01-01 00:00:02.250000 56
2012-01-01 00:00:03.250000 89
2012-01-01 00:00:04.250000 12