I want to split the data in two columns from the data frame and build new columns using this data.
My data frame,
dfc = pd.DataFrame( {"A": ["GT:DP:RO:QR:AO:QA:GL", "GT:DP:RO:QR:AO:QA:GL", "GT:DP:RO:QR:AO:QA:GL", "GT:DP:GL", "GT:DP:GL"], "B": ["0/1:71:43:1363:28:806:-71.1191,0,-121.278", "0/1:71:43:1363:28:806:-71.1191,0,-121.278", "0/1:71:43:1363:28:806:-71.1191,0,-121.278", "1/1:49:-103.754,0,-3.51307", "1/1:49:-103.754,0,-3.51307"]} )
I need separate columns with a name GT, DP, RO, QR, AO, QA, GLwith values from a columnB
I want to create an output like,

We can separate the two columns with a = df.A.str.split(":", expand = True)and b = df.B.str.split(":", expand = True)to get two separate data frames. They can be combined with c = pd.merge(a, b, left_index = True, right_index = True)to obtain all the desired data. But not in the format as expected.

? , split A B, dict A B . .