Error on removing strings from a pandas data frame - Python -


itemprop = "text">

I have a set and a function string variable in to remove 'nstandar' my panda data The set of frames, function and panda data frame are as follows:

  SETC = {'ADR', 'company', 'corporation', 'energy', 'ETF', 'group' ',' 'Ink', 'International', 'L'} Def quitarc (x): joining x = '' (one for an x ​​if not in a SETC) 0 1-800 nstandar return x Name. -FLOWERS.COM 1800flowerscom 1 1347 Property INC hldgs INC 1347 Property ins hldgs Inc 2 1 capital bank 1 capital bank 3 1 Century Bancshares Inc 1 Century Bancshares Inc 4 1st Constitution Bancorp 1 Constitution Bancorp 5 1 Lee Enterprise Bank 1 Enterprise Bank 6 1st Pacific Bancorp 1 Pacific Bancorp 7 1 La Source Corp 1 Source Corporation 8 1 Lee United Bancorp Inc 1 United Bancorp 9 21 Century Oncology Hldgs 21st Century Oncology Hldgs Congress   

However, when I To make a new variable without the wire, do not Infrastructure is just like 'nstandar' . The following is the code:.

  cemp ['newnstandar'] = cemp ['nstandar'] apply (quitarc)   

So, what is my error? Finally, I realized that the problem was with my function. I

Then I am modifying it and Its code is:

  def quitcomm (x): x = ''. (In A + "x.split") if not in setc) X = x.strip () return x    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -