Reputation: 3723
Given the following data frame:
d2=pd.DataFrame({'Item':['y','y','z','x'],
'other':['aa','bb','cc','dd']})
d2
Item other
0 y aa
1 y bb
2 z cc
3 x dd
I'd like to add a column index level 1 under the existing one (I think) because I want to join this data frame to another that is a multi-index. I don't want to alter the other data frame because I have already written a lot of code assuming its current structure.
Thanks in advance!
Upvotes: 2
Views: 459