Reputation: 121
I have a data file which contains 100 columns of 100 different series of solar irradiance vs. time. I want to plot all of these series on the same graph with the same time x-axis. Is there a way to do this in pandas without specifying the column names? I have not included headers in the results file. The number of data series will also change so I want the code to be able to cope with varying numbers of data sets.
I have been using matplotlib but I think this would be easier to handle in pandas, however everything I can find online suggests using the column headers.
So far all I have is this:
data = pd.read_csv(outputFile)
data.plot.line(x="Time")
Upvotes: 1
Views: 675
Reputation: 5335
Read the first column as index, then all remaining columns will be plotted.
data = pd.read_csv(outputFile, header=None, index_col=0, sep='\s+')
data.plot.line(xlabel='Time')
Upvotes: 3