Answers for "how explode by using two columns pandas"

1

how explode by using two columns pandas

df.set_index('col1').apply(pd.Series.explode).reset_index()
Posted by: Guest on August-17-2021
0

explode multiple columns pandas

(df.apply(lambda x: x.apply(pd.Series).stack())
              .reset_index()
              .drop('level_1', 1))
Posted by: Guest on July-19-2021

Code answers related to "how explode by using two columns pandas"

Python Answers by Framework

Browse Popular Code Answers by Language