My pandas dataframe has string like this
A=1;B=3;C=c6
A=2;C=c7;D=8
I want to extract the value in each field into separate columns, and then use the field name as columns like this
A B C D
1 3 c6 NaN
2 NaN c7 8
I tried split df.str.split('=|;', expand=True) but it splits both the value and field as separated columns
I also tried using df.str.extract(r'=\s*([^\.]*)\s*\;', expand=True) but it only return the first occurrence of the values.
Thank you for your help