I have two dataframes as below;
df1 = pd.DataFrame({'Group': ['A', 'A','B','B','C','C'],
'Col1': ['a1','a2','','','',''],
'Col2': ['', '', 'b1','b2','',''],
'Col3': ['', '', '','','c1','c2'],
'Col4': ['a11','a12','','','',''],
'Col5': ['', '', 'b11','b12','',''],
'Col6': ['', '', '','','c11','c12']
}
)
df2 = pd.DataFrame({'Group': ['A', 'A','B','B','C','C'],
'Field': ['Col1','Col2','Col3','Col4','Col5','Col6']
}
)
df2
I'm trying to combine the two dataframes to get an output like below; Any help?
Output format2 :