I have the following dataframe: [1]: https://i.stack.imgur.com/3gvRa.png
which has three sub-levels of indices. The first one is a number of 4 digits, the second is a date, and the last one is an index from the original dataframe.
I want to rename each level by ['District_ID', 'Month']
and to drop the third level. I already tried to drop the last one, and I used:
DF.index = DF.index.droplevel(2)
As a result, the third level is gone but the second one duplicates for all the rows. In addition I want to rename the column indices. How can I accomplish these tasks?