Skip to content

Commit 29662d9

Browse files
committed
Add impossible percent for RQ1
1 parent e6577e5 commit 29662d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rq1_data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,16 @@
119119
header_rows = newDF[ newDF['_style'] == 'HEADER' ].index
120120
data_rows = newDF[ newDF['_style'] != 'HEADER' ].index
121121

122+
impossiblePercent = newDF[FIELD_IMPOSSIBLE].apply(lambda x: "0" if x == "" else x).astype('int') / newDF[FIELD_JACOCO].apply(lambda x: "0" if x=="" else x).astype('int')
123+
newDF[FIELD_IMPOSSIBLE] = list(zip(newDF[FIELD_IMPOSSIBLE], impossiblePercent * 100))
124+
122125
latexTable = newDF \
123126
.drop(columns=['_style']) \
124127
.style \
125128
.hide(axis=0) \
126129
.format({
127130
FIELD_JACOCO: "{:.0f}",
128-
FIELD_IMPOSSIBLE: "-{:.0f}",
131+
FIELD_IMPOSSIBLE: lambda x: "-{:.0f} ({:.0f}\%)".format(*x),
129132
FIELD_MISSED: "+{:.0f}",
130133
FIELD_SYSNAME: "{:.0f}"
131134
}, subset=pd.IndexSlice[data_rows, :]) \

0 commit comments

Comments
 (0)