title: Convert number strings with commas in pandas DataFrame to float
body: <p>I have a DataFrame that contains numbers as strings with commas for the thousands marker. I need to convert them to floats.</p>
  
  <pre><code>a = [['1,200', '4,200'], ['7,000', '-0.03'], [ '5', '0']]
  df=pandas.DataFrame(a)
  </code></pre>
  
  <p>I am guessing I need to use locale.atof. Indeed </p>
  
  <pre><code>df[0].apply(locale.atof)
  </code></pre>
  
  <p>works as expected. I get a Series of floats.</p>
  
  <p>But when I apply it to the DataFrame, I get an error.</p>
  
  <pre><code>df.apply(locale.atof)
  </code></pre>
  
  <blockquote>
    <p>TypeError: ("cannot convert the series to ", u'occurred at index 0')</p>
  </blockquote>
  
  <p>and</p>
  
  <pre><code>df[0:1].apply(locale.atof)
  </code></pre>
  
  <p>gives another error:</p>
  
  <blockquote>
    <p>ValueError: ('invalid literal for float(): 1,200', u'occurred at index 0')</p>
  </blockquote>
  
  <p>So, how do I convert this <code>DataFrame</code> of strings to a DataFrame of floats?</p>