I have a panda dataframe like this:
id t value nodes sup
1 0 2 0.032396 [1, 2] 0
10 3 2 0.060529 [1, 2, 3] 0
and I would like to explode it to all possible powersets of the column nodes
:
id t value nodes sup
1 0 2 0.032396 [1] 0
10 3 2 0.060529 [1] 0
1 0 2 0.032396 [2] 0
10 3 2 0.060529 [2] 0
10 3 2 0.060529 [3] 0
1 0 2 0.032396 [1,2] 0
10 3 2 0.060529 [1,2] 0
10 3 2 0.060529 [1,2,3] 0
I am aware of the explode
method. but is there any suggestions on how to perform the above transformation?