我有以下形式的数据集dropbox 下载(23kb csv)
在某些情况下,数据的采样率从 0Hz 到超过 200Hz 从一秒到一秒不等,提供的数据集中的最高采样率约为每秒 50 个样本。
例如,当采集样本时,它们甚至总是分布在第二个样本中
time x
2012-12-06 21:12:40 128.75909883327378
2012-12-06 21:12:40 32.799224301545976
2012-12-06 21:12:40 98.932953779777989
2012-12-06 21:12:43 132.07033814856786
2012-12-06 21:12:43 132.07033814856786
2012-12-06 21:12:43 65.71691352191452
2012-12-06 21:12:44 117.1350194748169
2012-12-06 21:12:45 13.095622561808861
2012-12-06 21:12:47 61.295242676059246
2012-12-06 21:12:48 94.774064119961352
2012-12-06 21:12:49 80.169378222553533
2012-12-06 21:12:49 80.291142695702533
2012-12-06 21:12:49 136.55650749231367
2012-12-06 21:12:49 127.29790925838365
应该
time x
2012-12-06 21:12:40 000ms 128.75909883327378
2012-12-06 21:12:40 333ms 32.799224301545976
2012-12-06 21:12:40 666ms 98.932953779777989
2012-12-06 21:12:43 000ms 132.07033814856786
2012-12-06 21:12:43 333ms 132.07033814856786
2012-12-06 21:12:43 666ms 65.71691352191452
2012-12-06 21:12:44 000ms 117.1350194748169
2012-12-06 21:12:45 000ms 13.095622561808861
2012-12-06 21:12:47 000ms 61.295242676059246
2012-12-06 21:12:48 000ms 94.774064119961352
2012-12-06 21:12:49 000ms 80.169378222553533
2012-12-06 21:12:49 250ms 80.291142695702533
2012-12-06 21:12:49 500ms 136.55650749231367
2012-12-06 21:12:49 750ms 127.29790925838365
有没有一种简单的方法来使用 pandas 时间序列重采样功能,或者 numpy 或 scipy 中是否有一些可以工作的东西?