title: Reading delimited file columns as lists, returning rows instead
body: <p>I have a large .txt file and I'd like to read each column as a list. The file has 9 columns of delimited floats, the first line (of a few thousand) is:</p>
  
  <pre><code>0.49406565E-323  0.29532530E+003  0.89244837E+001  0.20901651E-002  0.34989878E+001  0.11594090E+000  0.34025716E-001  0.33723126E+001  0.27954433E+000  0.80757378E-001  0.50813056E+001
  </code></pre>
  
  <p>I'm reading my file like this:</p>
  
  <pre><code>colnames = ['weight', 'likelihood', 'A_0', 'w_0', 'p_0', 'A_1', 'w_1', 'p_1', 'A_2', 'w_2', 'p_2']
  data = pandas.read_csv('data.txt', names=colnames)
  
  weights = data.weight.tolist()
  A_0     = data.A_0.tolist()
  </code></pre>
  
  <p>The first column is the weight, and the rest are parameters and I want to perform a weighted average calculation of all the parameters with respect to their weights. </p>
  
  <p>But if I print <code>weights</code>, for example, it returns the entire file, and <code>weights[0]</code> is the first row of the file.</p>
  
  <p>For completion my weighted average would be something like:</p>
  
  <pre><code>weighted_A_0 = numpy.average(A_0, weights=weights)
  </code></pre>
  
  <p>Perhaps there's a neater way with pandas and numpy?</p>
  
  <p>Thanks!</p>