I would like to know how I can get something like this
Net 123 21 41 42 12 21
123 1 0 1 0 0 0
21 0 0 0 0 0 1
41 0 0 1 1 0 0
42 0 0 1 1 0 0
12 0 0 0 0 1 0
21 0 1 0 0 0 0
from the original dataset:
Net L
123 [123,41]
21 [21]
41 [41,42]
42 [42,41]
12 [12]
21 [21]
I thought of explode, but it works only on rows, not on columns.
pandas.crosstab.crosstabis what you’re after.