How to plot line chart with lines from index?
Question:
I have a dataframe I’ve already aggregated averages for, which are the columns nr_1, nr_2, etc. They are grouped by a bin, which is also now the index. How do I create a line plot where the lines are the index, and the X axis is nr_1, nr_2, etc. basically nr_1, nr_2, etc. are months so I want those to be on x axis, but have the mean values as the y axis? I can figure out how to change the x/y axis, but not how to make the index the individual lines. Here is an excel picture of what I am trying to achieve and a snippet of the dataframe (this is in python by the way):
Answers:
I have a dataframe I’ve already aggregated averages for, which are the columns nr_1, nr_2, etc. They are grouped by a bin, which is also now the index. How do I create a line plot where the lines are the index, and the X axis is nr_1, nr_2, etc. basically nr_1, nr_2, etc. are months so I want those to be on x axis, but have the mean values as the y axis? I can figure out how to change the x/y axis, but not how to make the index the individual lines. Here is an excel picture of what I am trying to achieve and a snippet of the dataframe (this is in python by the way):