Python - IndentationError: expected an indented block on a if
<p>I am new to python, so here is my problem.
I get the error "IndentationError: expected an indented block" on y_list in line 31 -> after the first if.
The file I load includes alot of numbers, and the idea is to skip the negative ones  in the socalled y_list.</p>

<pre><code>filename = "data_5.dat" # this file can also be found in the sandbox folder 
x_list = []
y_list = []

fp = open(filename)
for line in fp:
    var1, var2  = line.split(",")    # here we wish to split the line using the ',' character

    # since we want them in numeric format we need to convert
    a = float(var1)
    b = float(var2)

    # put them into two lists
    x_list.append(a)
    y_list.append(b)

fp.close()    # close the file


x = x_list
y = y_list

I = 0.0
L = 0.0

for k in range(1, len(x)):
if y_list&gt;0:
        y_list.append(y)
        I += y[k-1] * (x[k] - x[k-1])

for k in range(1, len(x)):
if y_list&gt;0:
        y_list.append(y)
        L += y[k] * (x[k] - x[k-1])

print I
print L
print (I+L)/2
</code></pre>
