I have a dataframe which looks like this:
Repo Averages for 25 Apr 2018
Business Date Instrument
25/04/2018 GC_AUSTRIA_SUB_10YR
25/04/2018 GC_AUSTRIA_SUB_10YR
25/04/2018 R_RAGB_1.15_10/18
25/04/2018 R_RAGB_4.35_03/19
25/04/2018 R_RAGB_4.35_03/19
25/04/2018 R_RAGB_1.95_06/19
I am looking to drop levels and get a dataframe similar to
Business Date Instrument
25/04/2018 GC_AUSTRIA_SUB_10YR
25/04/2018 GC_AUSTRIA_SUB_10YR
25/04/2018 R_RAGB_1.15_10/18
25/04/2018 R_RAGB_4.35_03/19
25/04/2018 R_RAGB_4.35_03/19
25/04/2018 R_RAGB_1.95_06/19
I have asked this question before and I know that I should be using df.columns.droplevel(1) but this time it does not work I get an error
AttributeError: 'Index' object has no attribute 'droplevel'
it is very strange that I get this message because in the same script i use similar trick to drop level. Yet for this dataframe it does not work. I am a bit puzzled,
In python the output looks like this
Out[226]:
Repo Averages for 25 Apr 2018 Unnamed: 1
1 Business Date Instrument
2 25/04/2018 GC_AUSTRIA_SUB_10YR
3 25/04/2018 GC_AUSTRIA_SUB_10YR
4 25/04/2018 R_RAGB_1.15_10/18
5 25/04/2018 R_RAGB_4.35_03/19
6 25/04/2018 R_RAGB_4.35_03/19
7 25/04/2018 R_RAGB_1.95_06/19
Help is appreciated