please see the link to answer , appreciated dataframe has 2 columns ID and Name
Name has array whats needed is to cross multiply column I Dto Name
and expected result shown in the image link provided
please see the link to answer , appreciated dataframe has 2 columns ID and Name
Name has array whats needed is to cross multiply column I Dto Name
and expected result shown in the image link provided
Lets use df.explode
-
df = pd.DataFrame({'ID':['A','B','C'],'Name':[['A','B','C'],['C','D'],['A']]})
df.explode('Name')
ID Name
0 A A
0 A B
0 A C
1 B C
1 B D
2 C A