I have a Dataframe that looks like this:
| Col 1 | Col 2 | 0| A | 2 | 1| A | 3 | 2| B | 1 | 3| B | 2 |
an
Here's a pivot solution:
(df.pivot('Col 1', 'Col 2', 'Col 1').fillna(0) != 0).rename_axis(index=None, columns=None)
1 2 3 A False True True B True True False