【发布时间】:2018-08-04 08:07:37
【问题描述】:
我是 pandas 的新手,现在我不知道如何安排我的时间系列,看看吧:
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
- “连接日期和时间”的分组和计数日期
- 把我数到的数字放进字典里?
你觉得我的逻辑怎么样?你知道一些tutos吗? 非常感谢
【问题讨论】:
-
重新接受的理由是什么?你不喜欢我的解决方案?
标签: python python-3.x pandas time-series