I have input dataframe in below format
I want the output in below format
Input data for referance
import pandas as pd
dfno = pd.DataFrame({'Nodes':['A','B','C'], 'Connections': ['Za,Eb', 'Qa,Rb', 'La,Mb']})
I tried below code to convert each value of both rows into list and then adding to dataframe. But it did not work. Here character in connection columns are getting split.
for index, row in dfno.iterrows():
node = str(row['Nodes'])
connec = list(str(row['Connections']))
print(node)
print(connec)
How to do this?