I've stumbled upon this problem and can't find a solution for hours. Basically I have the following two list, which I wish to transform to my final solution: A data frame, which has dates as the index and each instrument as a column with the respective values in that column.
In my first list I have the following structure:
[ Instrument Date
0 IWVL.L 2017-12-29T00:00:00Z
1 IWVL.L 2017-12-28T00:00:00Z
2 IWVL.L 2017-12-27T00:00:00Z
3 IWVL.L 2017-12-22T00:00:00Z
4 IWVL.L 2017-12-21T00:00:00Z
5 IWVL.L 2017-12-20T00:00:00Z, Instrument Date
0 IWMO.L 2017-12-29T00:00:00Z
1 IWMO.L 2017-12-28T00:00:00Z
2 IWMO.L 2017-12-27T00:00:00Z
3 IWMO.L 2017-12-22T00:00:00Z
4 IWMO.L 2017-12-21T00:00:00Z
5 IWMO.L 2017-12-20T00:00:00Z,
and so on (a total of 100 entries).
My second list has the following structure:
[ Instrument Total Return
0 IWVL.L 0.405743
1 IWVL.L -0.031201
2 IWVL.L 0.046824
3 IWVL.L -0.140274
4 IWVL.L 0.375469
5 IWVL.L 0.156691, Instrument Total Return
0 IWMO.L 0.294196
1 IWMO.L 0.080300
2 IWMO.L -0.080235
3 IWMO.L -0.213504
4 IWMO.L 0.321285
5 IWMO.L -0.120337,
Now I want a structure which puts dates as a index and the Instruments as separate columns (First Column: IWVL.K, Second Column: IWMO.L, and so on). The values of Total Return are then listed columnwise for the specific date. It looks like this (snippet for first two instruments):
IWVL.L IWMO.L ...
Date
2017-12-29 0.405743 0.294196 ...
2017-12-28 -0.031201 0.080300 ...
2017-12-27 0.046824 -0.080235 ...
Would be glad if somebody can help out here.
Oh and happy New Years eve!