去年我一直在跟踪我的游戏时间--只是为了获得我关心的数据和学习python。现在我想知道(和绘图--但还不重要)a玩游戏最多的时间(小时:0到23)在整个时间和所有活动上-自跟踪开始以来每天。
样品:
| 会话标识|游戏标识|开始日期时间|结束日期时间|
| - ------|- ------|- ------|- ------|
| 零零一|七十四|2023年2月22日13时15分|2023年2月22日15时30分|
| 002|一百二十七|2023年2月23日13时30分|2023-02-23 13:45:00|
| 零零三|七十四|2023年2月24日14时40分|2023年2月24日15时00分|
最后我想看到这个信息-计算列不需要:
| 一天中的小时|夏季游戏时数|平均每天玩游戏的小时数|计算|
| - ------|- ------|- ------|- ------|
| 十三|一点|0.33|(0.75 + 0.25)/ 3天|
| 十四|一点三三|0.44|(1.00 + 0.33)/ 3天|
| 十五|0.5分|0.17|(0.5)/ 3天|
总之,我不只是想看看我在哪几个小时玩过(玩过:1,没有玩0),而且还包括我玩的特定小时的比例。
我在网上看到过一些方法,但几乎所有的方法都只是对每个月或每天的是或否事件进行计数/求和,而不是计算一天/一小时的比例。
所以,我很高兴你有任何线索去哪里找。
1条答案
按热度按时间yb3bgrhw1#
设置:
诀窍是将每个会话分成几个小时:
我希望我的评论是可以理解的