title: sequence item 0: expected str instance, list found
body: <p>this is part of my code.it reads from an excel file.
  I'm getting a type error saying "TypeError: sequence item 0: expected str instance, list found".</p>
  
  <pre><code>text=df.loc[page,["rev"]]
   def remove_punct(text):
    text=''.join([ch for ch in text if ch not in exclude])
    tokens = re.split('\W+', text),
    tex = " ".join([word for word in tokens if word not in cachedStopWords]),
    return tex
  
   s=df.loc[page,["rev"]].apply(lambda x:remove_punct(x))
  </code></pre>
  
  <p>this is the error.</p>
  
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-16-4f3c29307e88&gt; in &lt;module&gt;()
       26   return tokens
       27 
  ---&gt; 28  s=df.loc[page,["rev"]].apply(lambda x:remove_punct(x))
       29 
       30  with open('FileName.csv', 'a', encoding="utf-8") as f:
  
  C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\series.py in apply(self, func, convert_dtype, args, **kwds)
     3190             else:
     3191                 values = self.astype(object).values
  -&gt; 3192                 mapped = lib.map_infer(values, f, convert=convert_dtype)
     3193 
     3194         if len(mapped) and isinstance(mapped[0], Series):
  
  pandas/_libs/src\inference.pyx in pandas._libs.lib.map_infer()
  
  &lt;ipython-input-16-4f3c29307e88&gt; in &lt;lambda&gt;(x)
       26   return tokens
       27 
  ---&gt; 28  s=df.loc[page,["rev"]].apply(lambda x:remove_punct(x))
       29 
       30  with open('FileName.csv', 'a', encoding="utf-8") as f:
  
  &lt;ipython-input-16-4f3c29307e88&gt; in remove_punct(text)
       23   text=''.join([ch for ch in text if ch not in exclude])
       24   tokens = re.split('\W+', text),
  ---&gt; 25   tex = " ".join([ch for ch in tokens if ch not in cachedStopWords]),
       26   return tokens
       27 
  
  TypeError: sequence item 0: expected str instance, list found
  </code></pre>