Pandas: get multiindex level as series
df['B'] = df.index.get_level_values(level=1) # Zero based indexing.
# df['B'] = df.index.get_level_values(level='second') # This also works.
>>> df
A B
first second
foo one 12 one
two 11 two
bar one 16 one
two 12 two
three 11 three
df['B'] = idx.to_series().str[1]