I am currently trying to take two columns from a *.csv file... log10 transform them, and then plot them up on a graph. The graph is not the issue, I just need to edit those two columns and plot them. The file does have a header row, there are 8 columns, and I would like to edit/use columns 5 and 7. None of the cookbooks or references I have found provide any good direction... Can anyone help me out?

Something like this...

f_in = open('file.csv')
lines = f_in.readlines()[1:]
fields = [item for item in lines.split(',')]
selected = []
for field in fields:
    selected.append((field[4], field[6]))

It will need adjusting...

Cheers and Happy coding

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.