How can I extract average temperature per day from a list of measurements?
<p>I have a <code>.txt</code> file like this:</p>

<pre><code>#day hr T 0.1 d.C.
1    1  137
1    2  124
1    3  130
1    4  128
1    5  141
1    6  127
1    7  153
1    8  137
1    9  158
1    10 166
...
2   1   136
2   2   135
2   3   135
2   4   132
and so on...
</code></pre>

<p>I wrote this code: </p>

<pre><code>import sys

NUMBEROFDAYS = []
NUMBEROFHOURS = []
Temp = []

for line in sys.stdin:
    x = (line[0:2])
    NUMBEROFDAYS.append(x)
</code></pre>

<p>What I get is:</p>

<pre><code>['#d', '1\t', '1\t', '1\t', '1\t', '1\t', '1\t', '1\t', '1\t', '1\t',   and it goes on...
</code></pre>

<p>However I need to extract relevant integers from the text.
How do I do that?</p>

<p>My final goal is to compute the average temperature for each day (the temperature is represented in the 3rd column).</p>