Suppose I have some team data as a dataframe `df`

.

```
home_team home_score away_team away_score
A 3 C 1
B 1 A 0
C 3 B 2
```

I'd like to a dataframe indicating how many times one team has beat another. So for instance the entry in `[1,3]`

would be the number of times team 1 has beat team 3, but the number in `[3,1]`

would be the number of times team 3 as beat team 1.

This sounds like something `df.pivot`

should be able to do, but I can't seem to get it to do what I would like.

How can I accomplish this using pandas?

Here is a desired output

```
A B C
A 0 0 1
B 1 0 0
C 0 1 0
```

`[A,B]`

is the number of times A beats B, and`[B,A]`

is the number of times B beats A.