我手头的任务是对时间序列数据进行异常检测。我有异常检测代码,但正在尝试为其准备数据。数据如下所示。
timestampUtc
2016-08-01 14:38:01, 2016-08-01 14:38:06, 2016-08-01 14:38:12, 2016-08-01 14:38:18, 2016-08-01 14:38:22, 2016-08-01 14:38:27, 2016-08-01 14:38:27, 2016-08-01 14:38:30, 2016-08-01 14:38:37, 2016-08-01 14:38:38, 2016-08-01 14:38:38, 2016-08-01 14:38:46, 2016-08-01 14:39:03, 2016-08-01 14:39:03, 2016-08-01 14:39:10, 2016-08-01 14:39:12, 2016-08-01 14:39:15, 2016-08-01 14:39:16, 2016-08-01 14:39:20, 2016-08-01 14:39:28
首先,我想让timestampUtc
列中的秒数为零。接下来,我想创建一个列,表示count
并想计算该特定分钟的值的数量。例如,输出应如下所示:
timestampUtc count
2016-08-01 14:38:00 12, 2016-08-01 14:39:00 6, 2016-08-01 14:40:00 8