1

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.

Shapshot of results file: enter image description here

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")

1 Answer 1

3

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')
Sign up to request clarification or add additional context in comments.

2 Comments

This doesn't give me any errors but also I don't get a plot out?
@UnaDavies Try to add in reading a file , sep='\s+'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.