I have a multi-index dataframe (with indices Date
and Company
) df
below:
Amount
Date Company
2019-10-01 BoA 3.924454e+09
Starfirst 1.346442e+04
Republic 7.006446e+06
2019-11-01 BoA 2.176354e+09
Starfirst 1.287342e+04
Republic 3.545446e+06
I want to convert df
to the below (where the Company
index is converted into columns, where Amount
is the values and Date
remains as an index):
BoA Starfirst Republic
Date
2019-10-01 3.924454e+09 1.346442e+04 7.006446e+06
2019-11-01 2.176354e+09 1.287342e+04 3.545446e+06
I've been trying to do this but haven't really got very far.