summing up the values of particular range of second column in a data file
<p>I have data file consisting of two columns, first column values range from -360 to 720 and second column consists of values for these.</p>

<p>I am trying to write a python code such that for a given value of first column, it should take the corresponding value of it and add up above 30 to below 30 values of second column.For eg, data file consists of </p>

<pre><code>.......
.......
-40 2.2
.......
.......
0   1.14
........
........
60  5.12
........
</code></pre>

<p>If a value of 20 is given then it should add the values of the second column starting from -10 to 50 i.e.,range for second column should be (20-30,20+30) I have tried it by taking each line as list in other list,but it's not working.</p>

<p>Is there any simpler way to do this?</p>

<p>Thanks in advance</p>
