Loading data into lists

Read input file into list of lines:
lines = ifile.readlines()
Now the 1st line is lines[0], the 2nd is lines[1], etc.
Store x and y data in lists:
# go through each line, 
# split line into x and y columns

x = []; y = []   # store data pairs in lists x and y

for line in lines:
    xval, yval = line.split()
    x.append(float(xval))
    y.append(float(yval))
See src/py/intro/datatrans2.py for this version

previousnexttable of contents