“unstack” a pandas column containing lists into multiple rows
Say I have the following Pandas Dataframe: df = pd.DataFrame({"a" : [1,2,3], "b" : [[1,2],[2,3,4],[5]]}) a b 0 1 [1, 2] 1 2 [2, 3, 4] 2 3 [5] How would I “unstack” the lists in the “b” column in order to transform it into the dataframe: a b 0 1 1 1 1 2 … Read more