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