In [1]:
import pandas as pd
import numpy as np
import matplotlib

In [15]:
# Read the data from the csv file using pandas
issues = pd.read_csv("patch_review.csv")

In [16]:
# Display the first 5 issues
issues.head()


Out[16]:
title id stage creation activity type components status creator
0 rlcompleter: tab on empty prefix => insert spaces 23441 4 2015-02-11.10:21:44 2015-07-27.17:46:50 5 ['9'] 1 43
1 msvc9compiler.py: add .asm extension 7546 4 2009-12-19.16:44:04 2015-07-27.14:59:35 6 ['3'] 1 11089
2 Clean up/refactor/make discoverable test_decimal 20008 4 2013-12-17.21:24:31 2015-07-27.14:10:35 6 ['12'] 1 15467
3 Tighten definition of bytes-like objects 23756 4 2015-03-24.08:25:17 2015-07-27.12:36:46 6 ['4'] 1 14751
4 Invalid access in combinations_with_replacement() 24735 4 2015-07-27.11:19:58 2015-07-27.12:06:44 5 ['5'] 1 11089

In [27]:
# issues
print("Number of issues with a patch: {0:4d}".format(len(issues)))


Number of issues with a patch:  939

In [7]:
#before 2011
i = issues
len(i[(i.activity <= '2011-01-01')])


Out[7]:
3

In [8]:
# 2011
i = issues
len(i[((i.activity <= '2012-01-01') & (i.activity > '2011-01-01'))])


Out[8]:
25

In [9]:
# 2012
i = issues
len(i[(i.activity <= '2013-01-01') & (i.activity > '2012-01-01')])


Out[9]:
66

In [22]:
# 2013
i = issues
len(i[(i.activity <= '2014-01-01') & (i.activity > '2013-01-01')])


Out[22]:
721

In [10]:
# 2014
i = issues
len(i[(i.activity <= '2015-01-01') & (i.activity > '2014-01-01')])


Out[10]:
366

In [11]:
# 2015 so far
i = issues
len(i[(i.activity > '2015-01-01')])


Out[11]:
343

In [12]:
# 2015 so far
i = issues
thisyear = i[(i.activity > '2015-01-01')]
len(thisyear)


Out[12]:
343

In [14]:
thisyear.head()


Out[14]:
title id stage creation activity type components status creator
0 rlcompleter: tab on empty prefix => insert spaces 23441 4 2015-02-11.10:21:44 2015-07-27.17:46:50 5 ['9'] 1 43
1 msvc9compiler.py: add .asm extension 7546 4 2009-12-19.16:44:04 2015-07-27.14:59:35 6 ['3'] 1 11089
2 Clean up/refactor/make discoverable test_decimal 20008 4 2013-12-17.21:24:31 2015-07-27.14:10:35 6 ['12'] 1 15467
3 Tighten definition of bytes-like objects 23756 4 2015-03-24.08:25:17 2015-07-27.12:36:46 6 ['4'] 1 14751
4 Invalid access in combinations_with_replacement() 24735 4 2015-07-27.11:19:58 2015-07-27.12:06:44 5 ['5'] 1 11089

In [29]:
# 2014 created
t = thisyear
len(t[t.creation > '2015-01-01'])


Out[29]:
718

In [28]:
# 2014 created
t = thisyear
len(t[(t.creation <= '2015-01-01') & (t.creation > '2014-01-01')])


Out[28]:
316

In [30]:
# 2013 created
t = thisyear
len(t[(t.creation <= '2014-01-01') & (t.creation > '2013-01-01')])


Out[30]:
170

In [31]:
# 2012 created
t = thisyear
len(t[(t.creation <= '2013-01-01') & (t.creation > '2012-01-01')])


Out[31]:
100

In [32]:
# 2011 created
t = thisyear
len(t[(t.creation <= '2012-01-01') & (t.creation > '2011-01-01')])


Out[32]:
78

In [33]:
# 2010 created
t = thisyear
len(t[(t.creation <= '2011-01-01') & (t.creation > '2010-01-01')])


Out[33]:
74

In [34]:
# Pre-2010 created
t = thisyear
len(t[t.creation <= '2010-01-01'])


Out[34]:
119

In [35]:
119+74+78+100+170+316+718


Out[35]:
1575

In [ ]:


In [ ]: