【发布时间】:2017-03-14 03:38:24
【问题描述】:
如何使用登录/注销事件时间创建类似于下面的时间轮?特别希望以时间轮方式将平均登录/注销时间与星期几相关联?下面的图片是一个示例,但我正在寻找时间在一周中的哪几天昼夜不停地在图片中显示。我有可用的 python 和包含登录时间的数据集。我还想将颜色与用户类型相关联,例如管理员与普通用户或类似的东西。关于如何实现这一点的任何想法都会很棒。
一些示例数据在下面的熊猫数据框中
df:
TimeGenerated EventID Username Message
2012-04-01 00:00:13 4624 Matthew This guy logged onto the computer for the first time today
2012-04-01 00:00:14 4624 Matthew This guy authenticated for some stuff
2012-04-01 00:00:15 4624 Adam This guy logged onto the computer for the first time today
2012-04-01 00:00:16 4624 James This guy logged onto the computer for the first time today
2012-04-01 12:00:17 4624 Adam This guy authenticated for some stuff
2012-04-01 12:00:18 4625 James This guy logged off the computer for the last time today
2012-04-01 12:00:19 4624 Adam This guy authenticated for some stuff
2012-04-01 12:00:20 4625 Adam This guy logged off the computer for the last time today
2012-04-01 12:00:21 4625 Matthew This guy logged off the computer for the last time today
【问题讨论】:
-
如果这还不够,我明天可以清理一些数据@stackoverflow.com/users/3877338/johne
-
也许来自@Weir_Doe 的this 是灵感的源泉?
-
您可以从同心圆环图构建这样的图表,如下所示:stackoverflow.com/questions/33019879/…
-
您是要将颜色与用户类型相关联,还是与此时的登录总数相关联,还是两者兼而有之?如果两者都有,那么您希望如何定义颜色?
-
我将按用户名分组,然后按星期几分组,然后按小时分组,并计算登录和注销的发生次数,尝试将登录定义为绿色热图和蓝色作为注销的热图,我假设我将不得不为此构建两张单独的图片,我对此很好
标签: python python-3.x pandas matplotlib visualization