In [76]:
import pandas as pd
import numpy as np
In [103]:
index = pd.MultiIndex.from_product([range(100), range(10)], names=['A', 'B'])
df = pd.DataFrame({'C': np.random.randn(1000)}, index=index)
In [105]:
df.head(20)
Out[105]:
In [106]:
df['C'] += index.get_level_values(1)
In [107]:
df.head(20)
Out[107]:
In [109]:
df2 = df.unstack(1)
In [112]:
df2.plot(kind='box', figsize=(8,6))
Out[112]:
In [ ]: