In [12]:
import dota2yearbeast
dota2yearbeast.DEBUG = False
history = dota2yearbeast.get_json_data()

In [10]:



--> 13/02/2015 21:45
--> 14/02/2015 01:30
--> 14/02/2015 04:35
--> 14/02/2015 07:25
--> 14/02/2015 10:47
--> 14/02/2015 14:02
--> 14/02/2015 19:13
--> 14/02/2015 22:33
--> 15/02/2015 02:17
--> 15/02/2015 04:57
--> 15/02/2015 09:27
--> 15/02/2015 12:25
--> 15/02/2015 19:12
--> 15/02/2015 22:29
--> 16/02/2015 01:55
--> 16/02/2015 05:33
--> 16/02/2015 08:51
--> 16/02/2015 11:55
--> 16/02/2015 14:51
--> 16/02/2015 17:52
--> 16/02/2015 21:02
--> 17/02/2015 00:24
--> 17/02/2015 03:21
--> 17/02/2015 06:18
--> 17/02/2015 09:28
--> 17/02/2015 12:35
--> 17/02/2015 16:13
--> 17/02/2015 19:03
--> 17/02/2015 22:11
--> 18/02/2015 01:20
--> 18/02/2015 04:56
--> 18/02/2015 08:34
--> 18/02/2015 12:11
--> 18/02/2015 15:31
--> 18/02/2015 18:35
--> 18/02/2015 21:56
--> 19/02/2015 00:55
--> 19/02/2015 04:06
--> 19/02/2015 07:32
--> 19/02/2015 11:21
--> 19/02/2015 15:07
--> 19/02/2015 18:04
--> 19/02/2015 21:02
--> 20/02/2015 00:00
--> 20/02/2015 03:50
--> 20/02/2015 07:26
--> 20/02/2015 10:50
--> 20/02/2015 14:00
--> 20/02/2015 17:37
--> 20/02/2015 21:13
--> 21/02/2015 00:35
--> 21/02/2015 04:02
--> 21/02/2015 07:03
--> 21/02/2015 10:45
--> 21/02/2015 13:50
--> 21/02/2015 17:14
--> 21/02/2015 20:25
--> 22/02/2015 00:06
--> 22/02/2015 03:40
--> 22/02/2015 07:27
--> 22/02/2015 11:12
--> 22/02/2015 14:40
--> 22/02/2015 18:24
--> 22/02/2015 21:54
--> 23/02/2015 01:05
--> 23/02/2015 04:29
--> 23/02/2015 08:16
--> 23/02/2015 11:57
--> 23/02/2015 15:12
--> 23/02/2015 18:34
--> 23/02/2015 22:25
--> 24/02/2015 01:53
--> 24/02/2015 05:12
--> 24/02/2015 08:04
--> 24/02/2015 11:36
--> 24/02/2015 14:52
--> 24/02/2015 18:32
--> 24/02/2015 22:17
--> 25/02/2015 01:48
--> 25/02/2015 05:30
--> 25/02/2015 08:42
--> 25/02/2015 11:39
--> 25/02/2015 15:14
--> 25/02/2015 18:48
--> 25/02/2015 22:19
--> 26/02/2015 01:42
--> 26/02/2015 05:00
==> 26/02/2015 08:45

In [39]:
import datetime
import pandas as pd
indx = pd.Index(history.keys())
durations = [int(history[i]['duration']) for i in history]
deltas = []
fechahora = None
for i in range(len(history)):
        try:
            deltas.append((history.keys()[i] - history.keys()[i+1]).total_seconds())
        except IndexError:
            deltas.append(0)

In [40]:
%pylab inline
dtf = pd.DataFrame({"Deltas": deltas, "Durations": durations}, index = indx)
dtf.describe()
dtf.plot()


Populating the interactive namespace from numpy and matplotlib
Out[40]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fbd53a05690>

In [49]:
sum(dtf.mean())


Out[49]:
13266.840909090908