replacing quotes, commas, apostrophes w/ regex - python/pandas
<p>I have a column with addresses, and sometimes it has these characters I want to remove => <code>'</code> - <code>"</code> - <code>,</code>(apostrophe, double quotes, commas)</p>

<p>I would like to replace these characters with space in one shot.  I'm using pandas and this is the code I have so far to replace one of them.</p>

<pre><code>test['Address 1'].map(lambda x: x.replace(',', ''))
</code></pre>

<p>Is there a way to modify these code so I can replace these characters in one shot?  Sorry for being a noob, but I would like to learn more about pandas and regex.</p>

<p>Your help will be appreciated!</p>

<p>You can use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.replace.html" rel="nofollow"><code>str.replace</code></a>:</p>

<pre><code>test['Address 1'] = test['Address 1'].str.replace(r"[\"\',]", '')
</code></pre>

<p>Sample:</p>

<pre><code>import pandas as pd

test = pd.DataFrame({'Address 1': ["'aaa",'sa,ss"']})
print (test)
  Address 1
0      'aaa
1    sa,ss"

test['Address 1'] = test['Address 1'].str.replace(r"[\"\',]", '')
print (test)
  Address 1
0       aaa
1      sass
</code></pre>

python string pandas replace dataframe