Remove comma from objects in a pandas dataframe column
<p>I have imported a csv file using pandas.</p>

<p>My dataframe has multiple columns titled "Farm", "Total Apples" and "Good Apples".</p>

<p>The numerical data imported for "Total Apples" and "Good Apples" contains commas to indicate thousands e.g. 1,200 etc.
I want to remove the comma so the data looks like 1200 etc.</p>

<p>The variable type for the "Total Apples" and "Good Apples" columns comes up as object.</p>

<p>I tried using <code>df.str.replace</code> and <code>df.strip</code> but have not been successful.</p>

<p>Also tried to change the variable type from object to string and object to integer but couldn't make it work.</p>

<p>Any help would be greatly appreciated.</p>

<p>****EDIT****</p>

<p>Excerpt of data from csv file imported using pd.read_csv:</p>

<pre><code>Farm_Name   Total Apples    Good Apples
EM  18,327  14,176
EE  18,785  14,146
IW  635 486
L   33,929  24,586
NE  12,497  9,609
NW  30,756  23,765
SC  8,515   6,438
SE  22,896  17,914
SW  11,972  9,114
WM  27,251  20,931
Y   21,495  16,662
</code></pre>