I have a simple Pandas data frame (df), structured like this:
a b c d
0 WW XX YY ZZ
1 AA BB CC DD
2 EE FF GG HH
3 ...
I'd like to get this into a nested tuple structure inside of a list that looks like this:
[ ((WW, XX), YY, ZZ), ((AA, BB), CC, DD), ((EE, FF), GG, HH) ... ]
I'm just starting Python/Pandas, so I'm not really sure how to go about this.
[((l[0], l[1]), l[2], l[3]) for l in df.values.tolist()]