Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how explode by using two columns pandas

df.set_index('col1').apply(pd.Series.explode).reset_index()
Comment

explode multiple columns pandas

(df.apply(lambda x: x.apply(pd.Series).stack())
              .reset_index()
              .drop('level_1', 1))
Comment

PREVIOUS NEXT
Code Example
Python :: python write binary 
Python :: form errors in django 
Python :: make the program title a name python 
Python :: discord.py say something 
Python :: time py 
Python :: how to check if a input is an integer python 
Python :: day name in python 
Python :: how to remove a string inside another string python 
Python :: drop every other column pandas 
Python :: python ftplib get list of directories 
Python :: pd.read_excel column data type 
Python :: ion flux relabeling 
Python :: numpy as array 
Python :: remove hyperlink from text python 
Python :: chr() python 
Python :: move all files in directory with shutils 
Python :: how to clear a list in python 
Python :: tasks discord py 
Python :: python subprocess print stdout while process running 
Python :: python pip jupyter notebook install 
Python :: pandas drop row from a list of vlaue 
Python :: STATIC_ROOT 
Python :: root mean squared error python 
Python :: How to load .mat file and convert it to .csv file? 
Python :: seaborn boxplot 
Python :: rc.local raspberry pi 
Python :: python get parent directory 
Python :: load json py 
Python :: python webdriver disable logs 
Python :: iter() python 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =