擅长:python、mysql、java
<p>这里似乎有更好的数据结构。。。在</p>
<pre><code>from collections import defaultdict
names=defaultdict(lambda :defaultdict(list))
with open('f.txt') as f:
lines = [l.split() for l in f.readlines() if l.strip()]
for l in lines:
names[l[0]][l[1]].append(float(l[2]))
</code></pre>
<p>现在,要从max/min得到计数和差值:</p>
^{pr2}$
<p>输出:</p>
<pre><code>00:12:34:23:45:67 136 1 0.0
00:12:34:23:45:67 134 3 432.104
45:34:23:45:44:23 133 1 0.0
3f:32:dr:45:34:r5 133 1 0.0
</code></pre>