我有一个dataframe,它包含一个操作id和一个事件开始和结束的日期时间戳。在
OperID Start End
141 2014-03-04 19:28:39 2014-03-04 19:33:38
10502 2014-03-04 02:26:26 2014-03-08 20:09:21
10502 2014-03-15 00:03:45 2014-03-15 10:03:44
我想采取这些数据,并能够轻松创建各种类型的箱子(月,日,小时) 显示在每个箱子中,操作处于受影响状态的时间。开始和结束日期通常跨越小时、日和月的边界。在
如果我是按天分类的话,我想要的输出是:
^{pr2}$
这是一个非常冗长的解决方案,循环很难摆脱:
如果你把1天算为86400秒,而不是86299秒,你不是把最后一秒数了两次吗?不管怎样都是小问题。在
相关问题 更多 >
编程相关推荐