title: How to setup string to float converters for numpy genfromtxt
body: <p>I found many ways to input csv files with text entries as numerical arrays in Python such as <a href="http://docs.scipy.org/doc/numpy/user/basics.io.genfromtxt.html" rel="nofollow">this</a> and <a href="http://penandpants.com/2012/03/09/reading-text-tables-with-python/" rel="nofollow">this</a>, but none were the situation I have and none worked for me.  I also couldn't find the answer in <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html" rel="nofollow">the manual</a> of numpy or other common tools for doing this, but maybe it's there and I just can't understand it.</p>
  
  <p>I have data in a csv like this:</p>
  
  <pre><code>"experiment 1"
  "var1","var2","var3","var4","var5"
  "7","0","1","3","1"
  "8","4","3","1","1"
  "8","5","3","3","1"
  "8","6","3","3","3"
  </code></pre>
  
  <p>I tried reading in the data using </p>
  
  <pre><code>dataArray = np.genfromtxt('Input Data/'+fileName,delimiter=',',skiprows=2)
  </code></pre>
  
  <p>and I also tried adding </p>
  
  <pre><code>.astype(np.float)
  </code></pre>
  
  <p>to the end.  But what I end up with in either case is:</p>
  
  <pre><code>[[ nan  nan  nan  nan  nan]
  [ nan  nan  nan  nan  nan]
  [ nan  nan  nan  nan  nan]
  [ nan  nan  nan  nan  nan]]
  </code></pre>
  
  <p>because converting strings found in numeric columns into nan is what genfromtxt is supposed to do according to the documentation.  There is also a <code>converters</code> parameter to <code>genfromtxt</code>, but the only example I could find of using it is from the documentation:</p>
  
  <pre><code>converters = {3: lambda s: float(s or 0)}
  </code></pre>
  
  <p>and I really can't make any sense of that syntax.  Assuming that the built-in converters can handle my data, what is the correct syntax for writing the converter parameter for that?  If the converters can't do what I need, does anybody know how to read this data in?  I expected this to be super simple, something I would find in 5 minutes, but I've wasted hours on this now.</p>