I have a problem with creating a line graph. I need to switch the x-axis with y-axis.
My idea is to visualize the Branch (F1, F2, F3, F4) on the y-axis and the weeks from 1-100 on the x-axis
If you have any idea how to do this please comment :) Thanks!
My data looks like that: data
My code:
data.set_index('Branch').plot()
plt.show()
CodePudding user response:
Try transposing the DataFrame prior to plotting:
data.set_index('Branch').T.plot()
plt.show()