I have been using panels in place of dataframes with multi-level indexing because they seem to be faster for large datasets. But I'm now transitioning to the Midx framework. With panel, I can do this easily:
import pandas as pd
pan = pd.Panel(np.random.randn(3,5,2),items=['p1','p2','p3'],minor_axis=['a','b'])
Then add a new item:
pan['p4'] = pd.DataFrame(np.random.randn(10,2),columns=['a','b'])
But with Midx:
cols = [['p1','p2','p3'],['a','b']]
idx = pd.MultiIndex.from_product(cols)
df_midx = pd.DataFrame(np.random.randn(10,6),columns=idx)
This returns an error:
df_midx['p4'] = pd.DataFrame(np.random.randn(10,2),columns=['a','b'])
ValueError: Wrong number of items passed 2, placement implies 1