我的问题是从记录每台计算机状态变化的数据中计算每次具体状态的计算机数量。
我有以下csv文件,用于记录计算机状态何时更改。
machine_id, status_id, time
1,10,2010-05-01 00:00:02 # the status of the machine 1 is changed to 10 at 05-01 00:00:02
2,3,2010-05-01 00:00:04
...
机器总数超过50,000,记录大小约为500万。状态数约为10
我需要获取每个时间段的每个状态的计算机数量。比如,结果文件如下所示:
time,status_id,number_of_computers
2010-05-01 00:00:00,1,12 # the number of computer whose status is 1 is 12 from 05-01 00:00:00 to 05-01 00:15:00
2010-05-01 00:00:00,2,23
...
2010-05-01 00:15:00,1,21
2010-05-01 00:15:00,2,32
...
我通常使用python pandas来完成这类任务,但可能数据太大了。
哪种工具适合这种任务?例如,python pandas,MySQL还是Java?如果您使用推荐的工具添加示例代码来实现此任务,我将不胜感激。