I have a dataframe like this:
df = pd.DataFrame({"X":['a', 'b', 'c', 'b', 'b', 'a'],
"Y":['A', 'B', 'A', 'C', 'A', 'A']})
Which method can I use to count the similar values and change it like this:
a b c
A 2 1 1
B 0 1 0
C 0 1 0