I have a csv file parsed from XML, and it is now in multi-level header data structure.
The df looks like this
ID category-1 category-2
address1 address2
label1 label2
1 CN DN
XN YN
XL DL
2 CX DN
UC UTC
UX UC
I want this data to be break into a normal dataframe
ID category1-address1-label1 category2-address2-label2
1 CN DN
1 XN YN
1 XL DL
2 CX DN
2 UC UTC
2 UX UC
I used read_csv().reset_index(), but it will lose many important information. Is there anyway I can make the multi-level header rows a normal csv df using pandas command?