Cannot convert string to float in pandas (ValueError)
<p>I have a dataframe created form a JSON output that looks like this:</p>

<pre><code>        Total Revenue    Average Revenue    Purchase count    Rate
Date    
Monday  1,304.40 CA$     20.07 CA$          2,345             1.54 %
</code></pre>

<p>The value stored are received as string from the JSON. I am trying to:</p>

<p>1) Remove all characters in the entry (ex: CA$ or %)
2) convert rate and revenue columns to float
3) Convert count columns as int</p>

<p>I tried to do the following:</p>

<pre><code>df[column] = (df[column].str.split()).apply(lambda x: float(x[0]))
</code></pre>

<p>It works fine except when I have a value with a coma (ex: 1,465 won't work whereas 143 would).</p>

<p>I tried to use several function to replace the "," by "", etc. Nothing worked so far. I always receive the following error:</p>

<blockquote>
  <p>ValueError: could not convert string to float: '1,304.40'</p>
</blockquote>