Re: reading a column from a file

2006-05-08 Thread Larry Bates
Check out the csv module. -Larry Bates Gary Wessle wrote: > Hi > > I have a file with data like > location pressure temp > str flootfloot > > I need to read pressure and temp in 2 different variables so that I > can plot them as lines. is there a package which reads from file with > a

Re: reading a column from a file

2006-05-08 Thread Larry Bates
Check out the csv module. -Larry Bates Gary Wessle wrote: > Hi > > I have a file with data like > location pressure temp > str flootfloot > > I need to read pressure and temp in 2 different variables so that I > can plot them as lines. is there a package which reads from file with > a

Re: reading a column from a file

2006-05-08 Thread pyGuy
f = open("datafile.txt", "r") data = [line.split('\t') for line in f] f.close() pressure = [float(d[1]) for d in data] temp = [float(d[2]) for d in data] --- This will parse the file into a matrix stored in 'data'. The last two lines simply iterate t

reading a column from a file

2006-05-07 Thread Gary Wessle
Hi I have a file with data like location pressure temp str flootfloot I need to read pressure and temp in 2 different variables so that I can plot them as lines. is there a package which reads from file with a given formate and returns desired variables? or I need to open, while not EO