How to remove levels from a multi-indexed dataframe?
df.reset_index(level=2, drop=True)
Out[29]:
A
1 1 8
3 9
You don't need to create a new DataFrame instance! You can modify the index:
df.index = df.index.droplevel(2)
df
A
1 1 8
3 9
You can also specify negative indices, for selection from the end:
df.index = df.index.droplevel(-1)