I have the following pd.Series
object.
ticker
date
2020-02-06 BKBR3
2020-02-06 BRKM5
2020-02-06 CNTO3
.......... ......
2020-02-06 BIDI11
2020-02-06 BRPR3
2020-02-06 CVCB3
2020-02-06 ELET3
2020-02-06 GFSA3
2022-01-26 QETH11
2022-01-26 ABEV3
2022-01-26 BIDI11
2022-01-26 CRFB3
2022-01-26 LCAM3
And I want to turn it into a boolean matrix (not sure if I'm using the appropriate terminology), that looks like the table below. It has the same index values from the original table, but the ticker column is pivoted and the values are True
when the column and index are in the original table and False
when they aren't.
BKBR3 BRKM5 CNTO3 .....
date
2020-02-06 True False False .....
2020-02-10 False False False .....
.......... ..... ..... .....
Does anyone know a clever way of doing it? I tried pivoting the table, but since it has no values, it didn't work.