我是熊猫的新手,现在我不知道如何安排我的时间序列,看看它:
date & time of connection
19/06/2017 12:39
19/06/2017 12:40
19/06/2017 13:11
20/06/2017 12:02
20/06/2017 12:04
21/06/2017 09:32
21/06/2017 18:23
21/06/2017 18:51
21/06/2017 19:08
21/06/2017 19:50
22/06/2017 13:22
22/06/2017 13:41
22/06/2017 18:01
23/06/2017 16:18
23/06/2017 17:00
23/06/2017 19:25
23/06/2017 20:58
23/06/2017 21:03
23/06/2017 21:05
这是 130 k 原始数据集的样本,我试过: df.groupby('date & time of connection')['date & time of connection'].apply(list)
我想还不够
我想我应该:
- 创建索引从 dd/mm/yyyy 到 dd/mm/yyyy 的字典
- 将“连接日期和时间”类型的 dateTime 转换为 Date
- 分组和计数“连接日期和时间”的日期
- 把我算的数字放在字典里?
你觉得我的逻辑怎么样?你知道一些短裙吗?非常感谢
原文由 Erwan Pesle 发布,翻译遵循 CC BY-SA 4.0 许可协议
You can use
dt.floor
for convert todate
s and thenvalue_counts
orgroupby
withsize
:或者:
时间: