matrix data in python
<p>I was trying to progressively subtract values of a 3D matrix. The matrix looks like:</p>

<pre><code>ATOM 1223 ZX SOD A 11 2.11 -1.33 12.33
ATOM 1224 ZY SOD A 11 -2.99 -2.92 20.22
ATOM 1225 XH HEL A 12 -3.67 9.55 21.54
ATOM 1226 SS ARG A 13 -6.55 -3.09 42.11
...
</code></pre>

<p>here the last three columns are representing values for axes x,y,z respectively.
now I what I wanted to do is, take the values of x,y,z for 1st line and subtract with 2nd,3rd,4th line in a iterative way and print the values for each axes.
I was using:</p>

<pre><code>for line in map(str.split,inp):
    x = line[-3]
    y = line[-2]
    z = line[-1]
</code></pre>

<p>for separating the values, but how to do in iterative way. should I do it by using <code>Counter</code>.<br>
Expected output:<br>
for line1 vs line2: <code>5.1 1.59 -7.89</code><br>
for line1 vs line3: <code>5.78 -10.88 -9.21</code><br>
...so on.</p>
