title: Importing data and variable names from a text file in Python
body: <p>I have a text file containing simulation data (60 columns, 100k rows):</p>
  
  <pre><code>a  b   c  
  1  11 111
  2  22 222
  3  33 333
  4  44 444
  </code></pre>
  
  <p>... where in the first row are variable names, and beneath (in columns) is the corresponding data (float type).</p>
  
  <p>I need to use all these variables with their data in Python for further calculations. For example, when I insert:</p>
  
  <pre class="lang-py prettyprint-override"><code>print(b)
  </code></pre>
  
  <p>I need to receive the values from the second column. </p>
  
  <p>I know how to import data:</p>
  
  <pre class="lang-py prettyprint-override"><code>data=np.genfromtxt("1.txt", unpack=True, skiprows = 1)
  </code></pre>
  
  <p>Assign variables "manually":</p>
  
  <pre class="lang-py prettyprint-override"><code>a,b,c=np.genfromtxt("1.txt", unpack=True, skiprows = 1)
  </code></pre>
  
  <p>But I'm having trouble with getting variable names: </p>
  
  <pre class="lang-py prettyprint-override"><code>reader = csv.reader(open("1.txt", "rt"))
  for row in reader: 
     list.append(row)
  variables=(list[0])  
  </code></pre>
  
  <p>How can I change this code to get all variable names from the first row and assign them to the imported arrays ?  </p>