I'm working with a mulit-index data frame. This is my first time ever dealing with this kind of thing. It's a bit unorthodox, but I know I really need two headers in this scenario. So, here's the first few columns of the DF.
df_append.columns.values
Result:
array([('IDRSSD', 'Unnamed: 0_level_1'),
('RCFD3531', 'TRDG ASSETS-US TREAS SECS IN DOM OFF'),
('RCFD3532', 'TRDG ASSETS-US GOV AGC CORP OBLGS'),
('RCFD3533', 'TRDG ASSETS-SECS ISSD BY ST POL SUB'),
('RCFD3534', 'TRDG ASSETS-MBS-PASS-THRU-FNMA,FHLMC'),
('RCFD3535', 'TRDG ASSETS-MBS-CMOS&REMICS-FNMA,ETC'),
('RCFD3536', 'TRDG ASSETS-MBS-ALL OTHER'),
I want to assign a name to this thing:
'Unnamed: 0_level_1'
It's blank now, and it's causing some problems for me. So, I tried this:
df_append.columns.values[:1] = ['IDRSSD','IDRSSD_ID']
That seems to create a list inside of the array. I don't think that's going to work. I think the thing that I need to do is to name this thing: 'Unnamed: 0_level_1'
to be this thing: 'IDRSSD_ID'
Or, if I am wrong, and this needs to be handled differently, please let me know. Thanks.