This should be easy. I have a pandas data frame with Date as index; it is a period index.
When I plot the data, the legend mentions "Series" while I want it to show "Loan type".
I tried reset_index() and work from there, but ‘Series’ keeps popping up in the upper left corner.
Series Loans Loans Housing ... Loans Agriculture Loans_Other
Date ...
2018Q2 100.0 58.058425 ... 14.498113 2.123517
2018Q3 100.0 58.366364 ... 14.439221 2.097073
2018Q4 100.0 58.588861 ... 14.343509 1.917685
2019Q1 100.0 58.693234 ... 14.189217 1.964198
2019Q2 100.0 58.936376 ... 14.187947 1.848167
>Solution :
Use rename_axis().
df.rename_axis("Loan type", axis=1)
