title: Error on removing strings from a pandas data frame - Python
body: <p>I have a set and a function to remove the strings that are in the variable <code>'nstandar'</code>of my pandas data frame. The set, the function and the pandas data frame are the following:</p>
  
  <pre><code>setc={'adr','company','corporation','energy','etf','group','holdings','inc','international','ltd'}
  
  def quitarc(x):
      x=''.join(a for a in x if a not in setc)
      return x
  
      Company name                         nstandar   
  0   1-800-FLOWERS.COM                    1800flowerscom
  1   1347 PROPERTY INS HLDGS INC          1347 property ins hldgs inc    
  2   1ST CAPITAL BANK                     1st capital bank   
  3   1ST CENTURY BANCSHARES INC           1st century bancshares inc 
  4   1ST CONSTITUTION BANCORP             1st constitution bancorp   
  5   1ST ENTERPRISE BANK                  1st enterprise bank    
  6   1ST PACIFIC BANCORP                  1st pacific bancorp    
  7   1ST SOURCE CORP                      1st source corporation 
  8   1ST UNITED BANCORP INC               1st united bancorp inc 
  9   21ST CENTURY ONCOLOGY HLDGS          21st century oncology hldgs
  </code></pre>
  
  <p>However, When  I create a new variable without the strings to remove, the new variable is just the same as <code>'nstandar'</code>. The code is the following:</p>
  
  <pre><code>cemp['newnstandar']=cemp['nstandar'].apply(quitarc)
  </code></pre>
  
  <p>So, What is my error? How Can I fix my codes?</p>