python - how to count number of numbers from columns?
<p>I have a file with the following input data:</p>

<pre><code>       IN   OUT
data1  2.3  1.3
data2  0.1  2.1
data3  1.5  2.8
dataX  ...  ...
</code></pre>

<p>There are thousands of such files and each has the same data1, data2, data3, ..., dataX
I'd like to count number of each value for each data and column from all files. Example:</p>

<p>In file 'data1-IN' (filename)</p>

<pre><code>2.3 - 50    (times)
0.1 - 233   (times)
... - ...   (times)
</code></pre>

<p>In file 'data1-OUT' (filename)</p>

<pre><code>2.1 - 1024 (times)
2.8 - 120  (times)
... - ...  (times)
</code></pre>

<p>In file 'data2-IN' (filename)</p>

<pre><code>0.4 - 312    (times)
0.3 - 202   (times)
... - ...   (times)
</code></pre>

<p>In file 'data2-OUT' (filename)</p>

<pre><code>1.1 - 124 (times)
3.8 - 451  (times)
... - ...  (times)
</code></pre>

<p>In file 'data3-IN' ...</p>

<p>Which Python data structure would be the best to count such data ? I wanted to use multidimensional dictionary but I am struggling with KeyErrors etc. </p>
