I have a data frame with multiple columns (194, 76) and I'm trying to plot multiple columns in a single plot by using Matplotlib.
To plot I use iloc command so I write,
plt.plot(finaldf.iloc[:, 0], finaldf.iloc[:, 51:76])
This does the job but when I try to insert the legends, which is basically the column header I always encounter problems.
For instance, if I use -
plt.plot(finaldf.iloc[:, 0], finaldf.iloc[:, 51:76], label=finaldf.columns.values)
plt.legend()
This basically includes all the columns name while I want to select only certains columns.
So I tried,
plt.plot(finaldf.iloc[:, 0], finaldf.iloc[:, 51:76], label=finaldf.iloc[0, 51:76])
plt.legend()
But this gives me the column name as well as the first value.
Can someone tell me how this would be possible?
Thank you in advance for your help.