There's a puzzle for you:
data = [ '2016-12-12 pass [pass]',
'2016-12-12 pass [pass]',
'2016-12-12 fail [fail]',
'2016-12-13 fail [fail]',
'2016-12-14 fail [fail]',
'2016-12-14 pass [pass]',
'2016-12-14 pass [pass]',
'2016-12-15 pass [pass]',
'2016-12-16 fail [fail]' ]
I've tried my best to solve it, but still can't figure out how to achieve this specific format:
2016-12-12 pass:2 fail: 1
2016-12-13 pass:0 fail: 1
2016-12-14 pass:2 fail: 1
2016-12-15 pass:1 fail: 0
2016-12-16 pass:0 fail: 1