I have a data with position (row/column),
df = pd.DataFrame({'ID': ['a01', 'a01', 'a01', 'a01', 'a01', 'a01', 'a01', 'a01', 'b02', 'b02', 'b02','b02', 'b02', 'b02', 'b02', 'b02'],
'Row': [1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 2, 2, 3, 3, 3],
'Col': [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 3, 1, 3, 1, 2, 3],
'Result': ['p', 'f', 'p', 'p', 'p', 'f', 'p', 'p', 'p', 'p', 'p', 'p', 'f', 'p', 'p', 'p']})
and I am trying to turn it into tables, and calculate how many p and f in the table, like these:
ID: a01
p f p
p p f
p p p
p: 7 f: 2
ID: b02
p p
p f
p p p
p: 6 f: 1
There are some missing data, but the number of the row and column are fixed, so just leave them blank.
I have no idea how to achieve this, any thought?