title: taking mean of data read in 'error cannot perform reduce with flexible type' python
body: <p>I am trying to read in data from a text file and take the mean of this data, but I am getting the error cannot perform reduce with flexible type. I dont know why, can somebody please help. here is my code. </p>
  
  <pre><code>right=open('01phi.txt','r').readlines()  
  right=str(right) 
  a=np.asarray(right)
  b=np.mean(a)
  print b
  </code></pre>
  
  <p><strong>EDIT</strong>: I am now using this line
  <code>right=np.genfromtxt('01phi.txt')</code>
  but it produces this error <code>Line #10 (got 3 columns instead of 7)</code> as this line in the array is not as big. <a href="https://stackoverflow.com/questions/3761103/using-genfromtxt-to-import-csv-data-with-missing-values-in-numpy">Using genfromtxt to import csv data with missing values in numpy</a> this link tells my how to ignore the bottom line or how to fill it in but both of these methods would sque the mean. is there a way to get around this?</p>