This is how the pandas dataframe looks like:
A | B | C | D |
---|---|---|---|
A1 | ['Bb1'] | [54] | [84.0] |
A2 | ['Bb2'] | [63] | [nan] |
Following is how the dataframe should be:
A | B | C | D |
---|---|---|---|
A1 | Bb1 | 54 | 84.0 |
A2 | Bb2 | 63 | nan |
As of pandas 1.3.0:
df.explode(['B', 'C', 'D'])
Or before:
df.set_index('A').apply(pd.Series.explode).reset_index()