I try to rename the Index column to ‘idx’ and get rid of 0 using this code:
df1.index.rename(name='idx', inplace=True)
However, I end up with the second dataframe as below. It results in messing up my boxplot by creating an empty plot of index column. Please guide me. Thank you.
0 | Company_A | Company_B |
---|---|---|
1 | 9.3 | 11.0 |
2 | 8.8 | 9.8 |
0 | Company_A | Company_B |
---|---|---|
idx | ||
1 | 9.3 | 11.0 |
2 | 8.8 | 9.8 |
2