Converting a pandas MultiIndex DataFrame from rows-wise to column-wise
问题 I'm working in zipline and pandas and have converted a pandas.Panel to a pandas.DataFrame using the to_frame() method. This is the resulting pandas.DataFrame which as you can see is multi-indexed: price major minor 2008-01-03 00:00:00+00:00 SPY 129.93 KO 26.38 PEP 64.78 2008-01-04 00:00:00+00:00 SPY 126.74 KO 26.43 PEP 64.59 2008-01-07 00:00:00+00:00 SPY 126.63 KO 27.05 PEP 66.10 2008-01-08 00:00:00+00:00 SPY 124.59 KO 27.16 PEP 66.63 I need to convert this frame to look like this: SPY KO PEP