I have a data frame
Name Address War
Stacy_A Stacy_A_1 A
Stacy_B Stacy_B_1 B
Stacy_C Stacy_C_1 C
Stacy_A Stacy_A_2 A
Stacy_B Stacy_B_2 B
Stacy_C Stacy_C_2 C
Stacy_D Stacy_D_2 O
so I have four unique names and under each name I have.
Stacy_A
has 2 addresses and both in WarA
Stacy_B
has 2 addresses and both in WarB
Stacy_C
has 2 addresses and both in Warc
Stacy_D
has only 1 address and in WarO
What I want is the output in the format having just count.
I need to have a format where I can get
names A B C O
Stacy_A 2 0 0 0
Stacy_B 0 2 0 0
Stacy_C 0 0 2 0
Stacy_D 0 0 0 1