I must use pandas 1.2.5 which supports explode() only on 1 column. The dataframe has several columns where each can have a single value or a list. In one row, several columns can have lists but it is guaranteed that all the lists in that row are the same length. What is the best way to make the dataframe explode?
Example of what I mean is to make this dataframe:
a | b |
---|---|
1 | 1 |
20 | [10,20,30] |
[100,200,300] | [100,200,300] |
Look like this dataframe:
a | b |
---|---|
1 | 1 |
20 | 10 |
20 | 20 |
20 | 30 |
100 | 100 |
200 | 200 |
300 | 300 |