Python ASCII Reading tables
<p>I'm really sorry for asking probably silly question but I have spend half a day and could not find reasonable solution.
I have ASCII file:</p>

<pre><code>      "X"           "Z"             "Y"
   285807.2      -1671.056        2405.91
   285807.2      -1651.162       2394.932
   285807.2      -1631.269       2383.962
   285807.2      -1611.375       2372.988
   285807.2      -1591.481        2362.01
   285807.2      -1571.587       2351.01
</code></pre>

<p>.............................................
~1 000 000 rows</p>

<p>And I normaly read it:</p>

<pre><code>from astropy.io import ascii

data =ascii.read('C:\\Users\\Protoss\\Desktop\\Ishodnik1.dat')
print (data)
</code></pre>

<p>But How could I deal with columns? For instance sum each rows or make an average value,  etc only from columns Z and Y? As I understand I have to converts all my date to list of float valuse except for  headliner and then to write new ASCII file, doesn't it?</p>

<p>What I did. I separated columns and added to different lists. Now I have got access for different columns:</p>

<pre><code>import numpy as np
    with open('C:\\Users\\Protoss\\Desktop\\Ishodnik.dat' ,'r') as f:
        header1 = f.readline()    
        X_list=[]
        Z_list=[]
        V_list=[]
        for line in f:
            line = line.strip()
            columns = line.split()
            X = (float(columns[0]))
            Z = (float(columns[1]))
            V = (float(columns[2]))
            X_list.append(X)
            Z_list.append(Z)
            V_list.append(V)
</code></pre>

python ascii